Android: resource String automatic generation

前端 未结 6 1198
心在旅途
心在旅途 2021-01-20 06:52

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_l

6条回答
  •  醉酒成梦
    2021-01-20 07:34

    I can't vote and i can't comment answers yet (missing reputation as i'm a new user)

    But i confirm :

    1) hard type the string in your code like
       mydlg.setTitle("hello guys");
    2) select your string (e.g : "hello guys")
    3) press Alt + Shift + A then press S
    

    a dialog will appear to let you add a new string into resources. Everything should be already filled into that dialog box.

提交回复
热议问题