I'm currently in a class that extends Application and would like to move back to previous activity (or start a new activity) based on another application's status. But I want to switch to another activity in the background and not show the activity to the user. Here's my code:
Intent launchIntent = new Intent(App.this, LoginActivity.class);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (launchIntent != null) {
startActivity(launchIntent);
}
I don't want it to get too complex with using Services but just an easy way to achieve what I want to achieve. Is that possible?