Friday, 15 May 2015

android - How to handle BackPressed key of for Fragment by custom? -



android - How to handle BackPressed key of for Fragment by custom? -

in android app, have used fragment ,but handling key have got problem , construction is,

its user business relationship structure, in that,

1)main wall=> in sub fragment->another fragment -> fragment

2)when click 1 button (friends wall button )which on screen , then, open wall same main wall .

3)from main wall go next screen.

i have maintain stack of fragment taking back, when key pressed. works main wall , friends wall user wall handling goes hard ,

please give me clue or suggestion handling such condition. ,now handle b

this right way using button in actionbar in screenshot below:

@override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { // respond action bar's up/home button case android.r.id.home: navutils.navigateupfromsametask(this); homecoming true; } homecoming super.onoptionsitemselected(item); }

android android-fragments

No comments:

Post a Comment