Hi all, I am getting error (stake trace shown bellow) in invoking method of one application from another using PathClassLoader and refelction API , eventhough both the applications are running in the same process as I had override attributes SharedUserId and process in the both the application. I had checked the same using "adb shell dumpsys activity" , and got confirmed that both the applications are running in the same process.
Is the PathClassLoader and reflection APIs is the right way to load the code from another application which is running in the same process or something else should be done for this? I am invoking method from another application using the following code, PathClassLoader pLoader = new PathClassLoader ("/data/app/ android.testcase.apk",ClassLoader.getSystemClassLoader()); try { Class cLoad = pLoader.loadClass ("android.testcase.TestCase"); Method mLoad = cLoad.getMethod("showPopup"); Object obj = cLoad.newInstance(); mLoad.invoke(obj); } catch (Exception e) { e.printStackTrace(); } and "showPopup" method in the android.testcase.TestCase calss wiil be as follows, public void showPopup()throws Exception{ Toast.makeText(this, "Loaded properly",Toast.LENGTH_SHORT).show (); } Can anyone please help to accomplish this task?? Thanks, Asif. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---