I have an application that raises from service on scheduled time. In that service, i have displayed my Activity using Intent. It works perfectly. But, when i go back, the activity is finished. But, one blank screen is remaining there? How can i avoid this blank screen. I need my application's Activity instead of blank screen. Anyone Guide me.
-
Please put some screen shots. – Shreyash Mahajan Jan 27 '12 at 04:35
-
Screen shot. You need the blank screen's screen shot. – Praveenkumar Jan 27 '12 at 04:48
-
Yes and also other sreen shot from where you navigate to that activity and got black screen ? – Shreyash Mahajan Jan 27 '12 at 04:58
-
@SherifelKhatib Yes, see [here](http://pastebin.com/CzbtDjeV) – Praveenkumar Jan 30 '12 at 11:50
-
@Špĸ remove this line: `i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);` – Sherif elKhatib Jan 30 '12 at 13:21
5 Answers
@Špĸ remove this line: i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
take a look at my post if you wish to open a dialog via your service: Creating global dialogs

- 45,786
- 16
- 89
- 106
I don't like that you finish an activity that you go back to. You have multiple of different alternatives:
Using fragments instead of activity intents.
Set flag to indicate the activity is done so it will close when you go back.
You could also try to work with the stack, look at this: https://stackoverflow.com/a/4038637/969325
Without seeing the code it is very diffcult to find out what is going wrong in your code but still I am making some effort to help you.
Add android:theme="@android:style/Theme.Translucent"
to your activity tag
in your manifest
file and then try if it works or not.

- 23,865
- 10
- 55
- 63
-
Yeah, it's working But, my application's `package` name will be displayed in title. – Praveenkumar Jan 27 '12 at 12:48
Have you tried setting FLAG_ACTIVITY_NO_HISTORY
in the intent you use to start the AlertDialog activity or launchMode="noHistory"
in the manifest.
The AlertDialog activity may very well be the blank screen you're seeing as no content view is set and the only thing a user sees is an alert dialog so once the alert dialog is dismissed and the app goes back to this screen it would be blank.

- 5,890
- 3
- 32
- 31