I want to show an alert box (like SMS alert) when a push notification is coming to device. My requirement is if the app is not visible or not running in forground, I want an alert box with transparent background. But is the app is running in forground, I just want an alert box where its background is the currently displaying activity. I can show it properly if the app is killed or running in foreground. But my problem is If the app is running in background, when the push notification comes, the alert box is visible withe background is the lastly running activity. I am displaying the alert box with开发者_开发知识库 in a new Activity where its background is transparent. How can I make invisible all activities in the app? Or how can I know how many activities are in stack? By knowing these I can finish all the activities..
Thank You...
Refer these links :
Closing several android activities simultaneously
http://coderzheaven.com/2011/08/how-to-close-all-activities-in-your-view-stack-in-android/
精彩评论