Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: resource String automatic generation

I'm new to Android. When I add a button/views in Graphical layout it adds the label text this way- android:text="Button" . Why doesnt it add "android:text="@string/my_label" and add a string resource in string.xml file. Can't it be done automatically in eclipse?

like image 885
Tanvir Avatar asked Oct 11 '25 20:10

Tanvir


2 Answers

I have searched a lot but I have not get any automated way to add a string to the resource file But This will save your time a lot IMHO.

Select a String, click Refactor --> Android --> Extract Android String.

like image 57
Siddiq Abu Bakkar Avatar answered Oct 14 '25 13:10

Siddiq Abu Bakkar


Thanks to Brent Hronik. CTRL-1 on Windows works fine.

like image 31
RuedigerKausK Avatar answered Oct 14 '25 12:10

RuedigerKausK