I want to go to another activity when I enter the onReceive
of my receiver, but it always stops working in startActivity
, the code I'm doing is like this:
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Hora de ir", Toast.LENGTH_LONG).show();
Intent i = new Intent(context, MyAlarmService.class);
context.startActivity(i);
}