I have this manifest:
<manifest ...
package="com.my">
<application ...>
<activity ...
android:name=".app.Run">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity ...
android:name=".app.Preferences"/>
<activity ...
android:name=".library.error.ErrorDialog"/>
</application>
</manifest>
How can I start ErrorDialog
activity from Run
activity?
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.my.library.error", "com.my.library.error.ErrorDialog"));
startActivity(intent);
Or
Intent intent = new Intent();
intent.setComponent(new ComponentName("library.error", "library.error.ErrorDialog"));
startActivity(intent);
Not working
MEA CULPA... MEA CULPA...
My ErrorDialog
Activity was not public. :D
1. Related to Application Manifest File
Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.run"/>
<activity android:name="app.run"/>
<activity android:name="library.error.ErrorDialog"/>
package app.run // Your Main Application Package Name
Activity:
Intent i = new Intent();
i.setClassName("app.run", "library.error.ErrorDialog"); //
startActivity(i);
setClassName()
2. Not related to Application Manifest File
Intent intent = new Intent();
intent.setComponent(new ComponentName("packagename whos activity u want to launch","classname.java"));
startActivity(intent);
setComponentName()
In your Case
Intent intent=new Intent();
intent.setComponent(new ComponentName("library.error", "library.error.ErrorDialog"));
startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With