0
I want to go to another Victoria when I enter onReceive
of my receiver, but always stops working on startActivity
, the code I’m making 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);
}
It may be a stupid question, but this one
MyAlarmService
is a Service? Why not start a Service in this way...– Wakim
Qual a Exception?
– Fernando Leal
is a normal class, I just put service by putting
– Enzo Tiezzi
Runtimeexception, and Activitynotfoundexception, the manifest being there
– Enzo Tiezzi
Did you put the package correctly? Or did you put it relative to the manifest package? Try to put the absolute path of Activity to see if the same problem happens.
– Wakim
just needed to add a flag FLAG_ACTIVITY_NEW_TASK.
– Enzo Tiezzi