Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PackageManager p = getPackageManager();
- ComponentName componentName = new ComponentName(this, MainActivity.class);
- p.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
- <receiver android:name="simpress.mobileinfo.MainActivity$MyBroadCastReceiver">
- <intent-filter>
- <action android:name="android.intent.action.BOOT_COMPLETED" />
- </intent-filter>
- </receiver>
- @Override
- public void onReceive(Context context, Intent intent) {
- if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
- Intent i = new Intent(context, MainActivity.class);
- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement