an droid可以是实现幵机自启动程序,就是通过继承 an droid.c on te nt.BroadcastReceiver 来实现广播,从而实现幵机启动这 个应用程序. 主要自启动代码是 public class HippoStartupI nten tReceiver exte nds BroadcastReceiver package com . easymorse ; import an droid .content .BroadcastReceiver import an droid .content .Con text ; import an droid .content .In te nt ; @Override public void on Receive ( Con text con text Intent intent ) { In te nt mBoot Intent =new Intent (con text , myboot . class ); mBootI ntent .setFlags (Intent . FLAG_ACTIVITY_NEW_TASK ); con text .startActivity ( mBootIntent );1 / 2 { 上面的代码还不能实现程序幵机自启动,主要在 置文件中添加filter : An droidMa nifest.xml 配 < receiver an droid:n ame > ="HippoStartup Inten tReceiver" > vinten t-filter vaction vcategory intent-filter receiver > an droid:n ame ="a ndroid.i nten t.actio n.BOOT_COMPLETED" ="a ndroid.i nte nt.category.HOME" /> /> an droid:n ame > 才能实现幵机自启动程序。 2 / 2 本文来源:https://www.wddqw.com/doc/b437273bb2717fd5360cba1aa8114431b80d8e35.html