Sunday, 15 September 2013

android - Helpp with activity stack( i am offering the bounty to whoever explains why and how it happens so that others can be helped,although i know why ;)) -



android - Helpp with activity stack( i am offering the bounty to whoever explains why and how it happens so that others can be helped,although i know why ;)) -

so here flow of app....i guess flow clear diagram shifting straight point

the notification can recreate player activity if destroyed.....

the playing screen starts foreground service...

so here stuck.... suppose start player activity fragment b,now press back,the player activity gets destroyed (after starting service , notification)....now press again,the fragments destroyed now....

now recreate player activity 1 time again notification,but pressing 1 time again not take me fragments destroyed already....i want take me fragments 1 time again (only if activity , activity b didn't start it,in other words activity , activity b not in stack)?how can accomplish it....

i can think of solution can override onbackpressed , start activity 1 time again proper checks on activity started , if activity destroyed or not ...and checks thought of global variables,but seems lame work around,is there way using activity stack etc ,by can solve ?

@override public void onbackpressed() { movetasktoback (true); } edit :i used above code in activity holds fragments

this did work,damn stupid ,i didn't seek before starting bounty anyways think might helpful others,also question , reply shows proper usage of movetasktoback .but don't know give bounty lol......

android android-fragments

No comments:

Post a Comment