Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to have same @+id and @string?

I'm new to Android programming. I spent a long time trying to look for a 'phantom line breakpoint' error in my code and I couldn't figure it out till I changed a string resource name.

I have an options.xml menu that contains

<item android:id="@+id/menu_about"
    android:title="@string/menu_about"
    android:icon="@drawable/ic_menu_about"></item>

My question - I have @+id/menu_about and @string/menu_about. is this possible?

Thank you very much

like image 664
nou Avatar asked Jan 24 '26 11:01

nou


1 Answers

Yes,its possible,and you can retrieve R.string.menu_about and R.id.menu_about.

and in autogenerated R.java have diffrent class for that.

like image 199
Samir Mangroliya Avatar answered Jan 26 '26 02:01

Samir Mangroliya