I have an Android app where I want to check to see if an app name that is installed matches a string passed to the function containing this code. The code and example is bel
Use the String's equals() method instead of the == operator for comparing strings:
info.activityInfo.applicationInfo.loadLabel( pm ).toString().equals(appName)
In Java, one of the most common mistakes newcomers meet is using == to compare Strings. You have to remember, == compares the object references, not the content.