Search code examples
androidbroadcastreceiver

Launch broadcast if disclaimer accepted but not before


I have an app which will use a broadcast receiver which will start when the phone is turned on.

However, when the user first installs and runs the app I want them to have to accept a disclaimer before the broadcast will do what it is designed to do.

Can anyone point me in the right direction?

Stephen


Solution

  • You can use SharedPreferences for this.

    Everytime BOOT_COMPLETED is recieved you can check for this preference. Only if it is true then continue.