程序设置的有开机自启动,但是没有生效
通过Android的开机广播设置的开机自启动但是没有生效public class BootBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, Intent intent) {
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000 * 30);
Intent bootIntent = context.getPackageManager().getLaunchIntentForPackage("com.dnt.infraredshelf");
context.startActivity(bootIntent);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
}
页:
[1]