android - Toolbar DisplayHomeAsUp Btn id -


i have trivial problem homeasup button in activity, not being executing or more concise id i'm checking not correct one, have ask, id homeasup button on toolbar ?

my code:

public boolean onoptionsitemselected(menuitem item) {     log.d("item "+item.getitemid());     log.d("home id "+android.support.v7.appcompat.r.id.home);     log.d("home id r "+r.id.home);     log.d("home id r "+r.id.homeasup);     if (item.getitemid() == r.id.a_profile_menu_item_edit) {         showprofileedit();         return true;     } else if (item.getitemid() == android.support.v7.appcompat.r.id.home) {         navutils.navigateupfromsametask(this);         return true;     }     return super.onoptionsitemselected(item); }   

and logs im printing printed:

d/profile[onoptionsitemselected] - 121﹕ item id 16908332 d/profile[onoptionsitemselected] - 122﹕ home id 2131492868 d/profile[onoptionsitemselected] - 123﹕ home id r 2131492868 d/profile[onoptionsitemselected] - 124﹕ home id r 2131492877 

so item.id 16908332 neither r.id.home, r.id.homeasup, android.support.v7.appcompat.r.id.home correct ones, appreciated...

you need android.r.id.home id 16908332. pay attention android in prefix.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -