I have service.apk that is using resources to show a notification in the status bar.
I am dynamically loading the class that is using these resources but then the resources for the notifications disappear somehow, and I'm getting this error:
W/ResourceType( 1142): No known package when getting value for resource number 0x7f020001
W/StatusBarIconView( 1142): Icon not found in 2130837505: 7f020001
W/StatusBarIconView( 1142): No icon for slot android/0x20
W/ActivityManager( 941): crashApplication: trying to crash self!
D/NotificationService( 941): onNotification error pkg=android tag=null id=32; will crashApplication(uid=1000, pid=941)
W/StatusBar( 1142): removeNotification for unknown key: android.os.BinderProxy@41b166b8
The code that dynamically loads:
PathClassLoader classLoader =
new PathClassLoader("system/app/ServiceImpl.apk",
ClassLoader.getSystemClassLoader());
Class someClass =
classLoader.loadClass("com.bla.ServiceImpl");
Constructor<Class> ctor = someClass.getConstructor(Context.class);
Object someObject = ctor.newInstance(context);
I'm thinking maybe the way I'm loading the apk is wrong? Maybe I should add a path for the resources?
Any Help would be very much appreciated!