tags:

views:

49

answers:

4

Hi. I have an application that runs only once. But after finishing (finish()), it remains in the history of applications (last opened) and can be opened again. (Long press on the Home button). How do I remove my application from this history?

I ask because everything I found, it's a flag in the manifest - 'noHistory'. But it works with Activiti history, not last opened Application history.

Thanks

A: 

In windows 7 right click the start menu. click properties click on the start menu tab. uncheck the two checkboxes under the privacy group.

You could also right click the item and remove it.

This may be better for SuperUser forum???

franky b
Sorry. It's my first question. Chose the wrong topic. Already fixed
No problem. These sites are awesome.. I have learned a lot here...
franky b
A: 

I'm not sure you can remove it from that dialog. However, you can enforce it being started only once through your code.

For example, you could use SharedPreferences and check a certain boolean key in onCreate() and if it's true, do:

finish();
return;

If it's false, set it to true and continue starting your activity as normal.

Felix
A: 

Adding the attribute android:noHistory="true" to an <activity> tag in the manifest works for me.

Perhaps you need to add this to every activity in your manifest if you're still having this issue?

Christopher
it's work partially. Ok. I have my application - MyApp. MyApp have Activity - A.
A -> startActivity(B) with NO_HISTORY flag. So it's works for activity B, but after finish() MyApp is visible in Application History still. In manifest all activities have android:noHistory="true" flag
A: 

I solved the problem.

Intent startupIntent = new Intent(context, MyActivity.class); startupIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startupIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(startupIntent);