我使用的是Android 3.2,我創建了我的Android應用程序,當我的平板電腦開始啓動完成時,它會自動啓動。Android啓動完成平板電腦啓動時的應用程序
一切正常,除了活動細運行兩次當應用程序被自動啓動(開機後完成)運行。
當我手動啓動應用程序時,不會引發此問題。
公共類BootStartUpApp擴展廣播接收器{
@Override
public void onReceive(Context context, Intent intent) {
Intent startUpApps = new Intent(context, StartMainActivity.class);
startUpApps.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(startUpApps);
}
}
清單文件我添加下面的代碼:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<receiver android:name="com.logica.eHealthBox.tab.activity.BootStartUpApp" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
有任何代碼向我們展示?。該廣播接收器部分將不勝感激。 – sebster 2013-03-25 07:38:35