Android debug setDisplayHomeAsUpEnabled what does it mean? -
i'm using setdisplayhomeasupenabled set of fragments, i.e. activity a, b, c, d fragments. upon pressing setdisplayhomeasupenabled, directs fragment x.... have not idea why happening, thought have declare following in oncreate() of activity
actionbar bar = getactionbar(); bar.setdisplayhomeasupenabled(true); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fraga fragment = new fraga(); fragmenttransaction.add(r.id.frag_container, fragment); fragmenttransaction.commit(); everything else works fine, except setdisplayhomeasupenabled button... directs fragment x(the settings page actually, thought directing frag a!!)
does have clue? big thanks!!
you can override behaviour of setdisplayhomeasupenabled. if want redirect screen want override behaviour following this:
@override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case android.r.id.home: // stuff break; } }
Comments
Post a Comment