Intent launchFacebookApplication=getApplicationContext().getPackageManager().getLaunchIntentForPackage("com.google.android.apps.messaging");
launchFacebookApplication.addCategory(Intent.ACTION_MAIN);
startActivity(launchFacebookApplication);
or
ComponentName compName=new ComponentName("com.google.android.apps.messaging","com.google.android.apps.messaging");
Intent intent=new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
//intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(compName);
startActivity(intent);
and in manifest:-
<queries>
<package android:name="com.google.android.apps.messaging"/>
</queries>
and getting error:-
PID: 2824
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.google.android.apps.messaging/com.google.android.apps.messaging}; have you declared this activity in your AndroidManifest.xml?
any wrong in this code , please help me out in this issue