Auto start application after boot completed in Android

前端 未结 5 876
时光说笑
时光说笑 2020-11-30 07:44

I want to make an application which has auto start option in its settings. I have made Settings activity in my application which is derived from PreferenceActivity and give

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 08:41

    You can use the shared preference to store a Boolean value for isAutoStartEnabled, and check this value in the BroadcastReciver, fire an intent only if it's true.

    In your case, the problem is not whether you receive the broadcast but who receives the broadcast. Best of luck..

    I hope it helps..

提交回复
热议问题