源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

android开机自启动app示例分享

  • 时间:2020-09-03 22:24 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:android开机自启动app示例分享
[u]复制代码[/u] 代码如下:
/*开机自动启动APP*/ public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("XRGPS", "BootReceiver.onReceive: " + intent.getAction()); if (ACTION_BOOT_COMPLETED.equals(intent.getAction())) {            Intent mBootIntent = new Intent(context, MainActivity.class);            mBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            context.startActivity(mBootIntent);      } else {         Log.w("XRGPS", "BootReceiver: unsupported action");     } } }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部