I've got the following problem: There are the Activities A, B, C and D. Each Activity of B, C and D contain a list of items.
Now let's start at A: From A i want to go to Activity D to select an Item and put it in somewhere in A. But to get from A to D I've got to go through B and C. That is because B, C and D represent a tree of objects.
So I start the activities the following way: A => B => C => D in the end I want to pass the item from D to A.
Up to that my code is working correctly!
But: Imagine the user chose the wrong item in Activity C. Therefore he will get the false list in Activity D. What would the user do? The user would go back to C, choose the correct item, so the correct list in D will be shown. Then the user will choose the wanted item in D, which shall be passed back to Activity A.
That doesn't work. So whenever the user uses the back-button to get one level back in the tree, the code doesn't work anymore.
Specifically it doesn't work because if I went back from D to C the Activity C does not have a calling Activity anymore (actvityC.getCallingActivity() is null).
To go from A to B I use startActivityForResult(). To go from B to C and from C to D I use startActivity() and Intent.FLAG_ACTIVITY_FORWARD_RESULT.
I hope you understand my problem nad can help me.
Greetings
Aucun commentaire:
Enregistrer un commentaire