android 开机启动应用

public class StartupReceiver extends BroadcastReceiver {  
  @Override  
  public void onReceive(Context context, Intent intent) {  
    Intent startupintent = new Intent(context,StrongTracks.class);  
    startupintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
    context.startActivity(startupintent);  
  }  
}  

<receiver android:name=".StartupReceiver">  
    <intent-filter>  
        <!-- 系统启动完成后会调用 -->  
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
    </intent-filter>  
</receiver>

posted on 2016-09-05 13:23  miaozhenzhong  阅读(111)  评论(0编辑  收藏  举报

导航