In my application, I register BroadcastReceiverin the method onCreate()for Service.
registerReceiver(receiver, newIntentFilter(myAction));
Now I need to start the activity from the newly registered BroadcastReceivereach time onReceive(Context context, Intent intent):
Intent i = new Intent(context,MyClass.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
"Context" is that Contextwhich has been conveyed to mine BroadcastReceiver. It successfully worked and started Activity. Is this the correct and reliable way to start Activityinside a BraodcastReceiverfrom a Service? Because there is a lot to receive Context, for example getApplicationContext()or getApplication()etc.
In my situation is used Context, which was correctly transferred to mine BroadcastReceiver?