0

My application has a transparent activity and every time I start that activity I would like to show it over launcher only (i.e) if any other app is open, I would like to push that app into the recents stack and show my application over launcher only. Is it possible to do this programmatically?

Actual Use case :

I am trying to start this activity from lockscreen and the issue is if the device was locked when another application was running and I try to start this activity from lockscreen at that point, we see this transparent activity over the application that was running prior to the device being locked.

shilovk
  • 11,718
  • 17
  • 75
  • 74
  • on your app start, you can start the launcher using intent, and then start your transparent activity using another intent – Vladyslav Matviienko Sep 15 '17 at 06:40
  • check out this , try out with pushing different Intent https://stackoverflow.com/questions/17542517/activity-with-transparent-background and https://stackoverflow.com/questions/2176922/how-do-i-create-a-transparent-activity-on-android – Sreehari Sep 15 '17 at 07:32
  • Welcome to SO. Users are expected to show some effort and code whilst SO is here to help you solve specific programming problems along the way. Please show us your attempt to solve the problem. – Maciej Jureczko Sep 15 '17 at 07:35

1 Answers1

0

When you call the activity, then you have to add Category_home so that you activity will always be on the launcher activity.

Intent intent = new Intent(Intent.ACTION_MAIN);
intent .addCategory(Intent.CATEGORY_HOME);
intent .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent (startMain);
Machavity
  • 30,841
  • 27
  • 92
  • 100
Naimatullah
  • 3,749
  • 2
  • 13
  • 12