Calling startActivity() from outside of an Activity?

if your android version is below Android – 6 then you need to add this line otherwise it will work above Android – 6.

...
Intent i = new Intent(this, Wakeup.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
...

Leave a Comment