0
<item
        android:title="bookmark"
        android:icon="@drawable/ic_baseline_bookmark_border"
        android:id="@+id/bookmark"
        app:showAsAction="ifRoom"/>

Hi, in the above code I am showing a bookmark icon in a menu item but now my requirement is to read the icon name, I am able to read or get the id of this item by using the below code

@Override
    public boolean onOptionsItemSelected(@NonNull MenuItem item) {
        int res_id=item.getItemId();
}

but I am not able to get the icon name

please help !! thanks in advance

Piyush Jiwane
  • 179
  • 3
  • 13

1 Answers1

0

please refer this article for getting more information while referring this question

https://android.i-visionblog.com/android-changing-menu-items-at-run-time-48970f0cf1b7

all thanks to Ramkumar N

Piyush Jiwane
  • 179
  • 3
  • 13