0

I have included the ePubReader Android Project as a library in my App named "Test" and trying to launch the ePubReader via "Test" using Intent as follows:

Test App:

findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {


    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub

            Intent LaunchIntent = new Intent("it.angrydroids.epub3reader.EpubReaderLauncher");
        startActivity(LaunchIntent);

        }
        });

To handle the Intent, I have made a registry in the Manifest XML of ePubReader as below:

Manifest XML of ePubReader:

<activity
android:name=".EpubReaderLauncher"  
android:label="@string/app_name" >  
<intent-filter> 
<action android:name="it.angrydroids.epub3reader.EpubReaderLauncher" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

When I launch my App named Test, I'm getting the Error as No activity found to handle the Intent. I investigated and didn't find any clue of Launching the Library App.

Shyam
  • 6,376
  • 1
  • 24
  • 38
Anandaraja_Srinivasan
  • 568
  • 1
  • 10
  • 25

2 Answers2

0

Why not try this as your intent

    Intent intent = new Intent(this, EpubReaderLauncher.class);
    startActivity(intent );
Carlos Robles
  • 10,828
  • 3
  • 41
  • 60
keshav
  • 3,235
  • 1
  • 16
  • 22
0

You should ask the package manager to create a proper intent to open that app:

 Intent i;
PackageManager manager = getPackageManager();
try {
    i = manager.getLaunchIntentForPackage("it.angrydroids.epub3reader");
    if (i == null)
        throw new PackageManager.NameNotFoundException();

    startActivity(i);
} catch (PackageManager.NameNotFoundException e) {
}
Carlos Robles
  • 10,828
  • 3
  • 41
  • 60
  • Carlos, This invokes the Library Project if and only if the Library project(it.angrydroids.epub3reader) is installed. breaks the total idea of adding as library. Is there any way we can make the Library project to launch without any installation of it. – Anandaraja_Srinivasan Jan 15 '14 at 11:45
  • yeah you are true. And what if you include all the code in your src folder, so it is shipped with your app? Im sorry but i this dirty thing is the only the come to my mind at this point. – Carlos Robles Jan 15 '14 at 17:05