Search Results

Search found 1 results on 1 pages for 'diljeet'.

Page 1/1 | 1 

  • asses resouces from another apk for widget(like theme apk)

    - by Diljeet
    asses resouces from another apk for widget(like theme apk) Hello i made a theme with drawables and strings, i can access the theme's resources by following commands String packagename="com....."; Resources res = context.getPackageManager().getResourcesForApplication(packagename); int strid = res.getIdentifier(packagename+":string/"+name, "string", packagename); int drawableid = res.getIdentifier(packagename+":drawable/"+name, "drawable", packagename); String name = res.getString(resid); Bitmap bmp = BitmapFactory.decodeResource(res, resid); //or Drawable dr=res.getDrawable(resid); I can get the drawables, but i don't know how to set the drawables in xml to a widget. I only can set setImageViewResource(int viewid, int resId); So i am asking that how to access xml resources from another apk and set widget drawables from it. I want to access a resource like this from another theme apk, but i can only access the drawable(so can't use it for widgets) <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/wplayh" /> <item android:drawable="@drawable/wplay" /> </selector>

    Read the article

1