• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Bring application to front programmatically

Hi

I have an Android application build with API level 26 and I am trying to bring the application in front from a service when a specific command is received from a remote server. My current approach is to use

Intent i = new Intent(MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);

however this brings the application to front only if there is no other application already in front. I need to cope with this situation, when needed to bring my application to front regardless if another application is already in front of not. Is this possible ?

thanks
Bogdan
 
Back
Top Bottom