android - How to start activity in another application? -


i have application defined below:

<application android:icon="@drawable/icon" android:label="@string/app_name">     <activity android:name="com.example.myexampleactivity"               android:label="@string/app_name">         <intent-filter>             <action android:name="android.intent.action.main" />             <category android:name="android.intent.category.launcher" />         </intent-filter>     </activity> </application> 

now in application b, how can write code start activity in application a? thanks!

the other solution works 2 activities in same application. in case, application b doesn't know class com.example.myexampleactivity.class in code, compile fail.

i searched on web , found below, , works well.

intent intent = new intent(); intent.setcomponent(new componentname("com.example", "com.example.myexampleactivity")); startactivity(intent); 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -