Reputation: 3728
I want to open an activity of one application inside another application for that I am doing
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.settings",
"com.android.settings.audiopreferences.SystemAudioSettings"));
context.startActivity(intent);
if i execute above Im getting the below Exception
id=1: thread exiting with uncaught exception (group=0x40fac930)
E/AndroidRuntime( 2741): FATAL EXCEPTION: main
E/AndroidRuntime( 2741): java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.android.settings/.audiopreferences.SystemAudioSettings } from ProcessRecord{414c0b58 2741:com.dea600.radioapp/u0a10071} (pid=2741, uid=10071) not exported from uid 1000
E/AndroidRuntime
Upvotes: 0
Views: 763
Reputation: 4981
Try this
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
startActivity(LaunchIntent);
Upvotes: 0
Reputation: 336
android:exported="true"; // Have to include it in the manifest file - activity to be used across multiple applications
Example
<activity
android:name="com.example1.utility.MainActivity"
android:exported="true"
android:label="@string/app_name" />
Using MAinActivity from Another application
Intent intent = new Intent();
intent.setClassName("com.example.utility", "com.example1.utility.MainActivity");
context.startActivity(intent3);
Upvotes: 1
Reputation: 919
You're trying to open a settings activity from the system. You'll have a better chance of using the actual "action" for that activity. Try
context.startActivity(new Intent("android.settings.SOUND_SETTINGS"));
Upvotes: 0