I have created two projects. The first one, extracts information of handset and shows on the screen. I have .apk file of this project (for example test.apk).
Then I created second project. This one has a button on the screen and I want when I click the button, first project runs (shows information of handset). I have added test.apk into this project by right clicking on root of project>Build Path>Configure Build Path>Add External JARs>test.apk
Then in the code, I called this by using intent. this is my code:
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent("com.in.test.MainActivity");
startActivity(intent);
}
});
however, when I run the application, according to logcat, I see following error: 11-18 10:09:28.933: E/AndroidRuntime(2237): Uncaught handler: thread main exiting due to uncaught exception 11-18 10:09:29.022: E/AndroidRuntime(2237): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.in.test.MainActivity } 11-18 10:09:29.022: E/AndroidRuntime(2237): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1484) . . .
What and where is my problem? Thanks
update:
In the manifest file I added this line inside of application
element:
<activity
android:name="com.in.test.MainActivity" />
but the result is still the same. I'll try to follow your suggestion (using intent filter).