Given the following code, I know how to get a list of ResolveInfo that
describes all of the installed applications, but I am not sure how to
get the names of the applications as seen in the home menu.
PackageManager pm = this.getPackageManager();
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> list = pm.queryIntentActivities(mainIntent, 0);
Currently I can get the packageName and className of a given
application as such:
ResolveInfo re = list.get(position);
String packageName = re.activityInfo.packageName;
String className = re.activityInfo.name;
But as far as getting the same name that you would find if you were to
do
Context ctx = this;
Resources appR = ctx.getResources();
CharSequence txt = appR.getText(appR.getIdentifier("app_name",
"string", ctx.getPackageName()));
I cannot seem to figure out how to just get the name. Obviously this
is possible because there are applications that replace your home
screen and so forth, but I have been searching for hours to no avail.
Thanks!
-Sam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---