注册一下开机广播,public class BootReciver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {Intent mBootIntent = new Intent(context, Service.class);context.startService(mBootIntent);}}然后在广播中启动自己的程序