How to get another application's resource

Put your problem here if it does not fit any of the other categories.

How to get another application's resource

Postby ForD » Tue Jan 15, 2008 2:44 am

Assuming I know the resource id, does anyone know how I could retrieve the resource of another application stored on the phone? Note the the constants that come on the ResolveInfo, ActivityInfo, and ApplicationInfo classes aren't working for what I need.
ForD
Freshman
Freshman
 
Posts: 3
Joined: Tue Jan 15, 2008 2:42 am

Top

Postby ForD » Wed Jan 16, 2008 12:31 am

anybody have any ideas? I just tried to resources object as well, which didn't work.
ForD
Freshman
Freshman
 
Posts: 3
Joined: Tue Jan 15, 2008 2:42 am

Postby ForD » Wed Jan 16, 2008 3:19 am

Well, I ended up figuraing out how to do this, here's the code for posterity:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent mainIntent = new Intent(Intent.MAIN_ACTION, null);
  2.  
  3. mainIntent.addCategory(Intent.LAUNCHER_CATEGORY);
  4.  
  5. List<ResolveInfo> apps = ZoomGrid.context.getPackageManager().queryIntentActivities(mainIntent, 0);
  6.  
  7. Resources r = ZoomGrid.pm.getResourcesForApplication(apps.get(1).activityInfo.applicationInfo);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


change the 1 in apps.get(1) to a different number to change the app. Then use the properties of the r (Resources) object to get the resource by id.
ForD
Freshman
Freshman
 
Posts: 3
Joined: Tue Jan 15, 2008 2:42 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests