Reputation: 1697
I am working on one application which basically is an auto-start application and runs in background.
The problem is I need to access shared preference before auto start. But if device is not properly booted up how can I access the shared preference?
I want that either if device is completely booted then start my service or I can set any wait to my service to start.
Upvotes: 1
Views: 427
Reputation: 16603
You should use the permission android.permission.RECEIVE_BOOT_COMPLETED
and register a BroadcastReceiver
for android.intent.action.BOOT_COMPLETED
Upvotes: 3