Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

navigation in a android app with FLAG_ACTIVITY_NO_HISTORY & startActivityForResult

Tags:

android

I have a problem with navigation in an android app with FLAG_ACTIVITY_NO_HISTORY and startActivityForResult.

Here is an example:

I have page A and page B. I go from A to B with the FLAG_ACTIVITY_NO_HISTORY. Then I take a picture with startActivityForResult.

The problem is, now I get back to page A, but I want to get back to page B.

When I remove the FLAG_ACTIVITY_NO_HISTORY I have page B in the history which I don't want to have.

How to resolve this problem?

like image 938
gurehbgui Avatar asked Oct 23 '22 05:10

gurehbgui


1 Answers

Use the history, but when you come back to your page B, just call this.finish(). This activity will end. You will probably see your page B for a second (could be depend on your code, to test).

Hope this solution could help you.

like image 51
Stephane Avatar answered Nov 03 '22 00:11

Stephane