How to call browser in BroadcastReceiver in android? Can any one help me? I tried by using to set flags for intent. It is not coming it saying error
Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
Thanks in advance
The error is self-explanatory. Add
Intent.FLAG_ACTIVITY_NEW_TASKto yourIntentvia thesetFlags()method.As I noted in another of your questions, calling
startActivity()from aBroadcastReceivermay not be what the user wants.