android - How to retrieve the drawable name using id? -


i have imageview changes depending on imagebutton clicked trying name of imagebutton pressed , since know id of imageview, wondering how retrieve name of drawable. searched on internet , found ways of getting id using drawable name or getting entire file path of drawable, there way name of drawable , without extension also, thanks

since imagebutton imageview use tagging:

imagebutton button = (imagebutton) findviewbyid(r.id.buttonid)// button button.settag("youdrawablename"); // drawable name 

and read need it:

string drawablename = (string) button.gettag(); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -