昨天了解了Alt+Enter快捷键的大用处,今天又发现了一个快捷的方法,必须记下来。转载请注明出处http://www.cnblogs.com/LT5505/p/5466630.html 

1、首先代码中的字符串如下图所示:

Android Studio 轻松整理字符串到string.xml中

 

2、然后选中字符串“hello world”,同时按住Alt+Enter,即可看到弹出选择的对话款,选择其中的“Extract string resource”;

Android Studio 轻松整理字符串到string.xml中

 

3、选择之后,然后看到Extract Resource对话框,我这里直接填写字符串的名字为string;

Android Studio 轻松整理字符串到string.xml中

 

4、点击OK后,之前的字符串就成功整理到了string.xml文件中了,结果如图所示,而且不用担心手动的改动出错。

Android Studio 轻松整理字符串到string.xml中

Android Studio 轻松整理字符串到string.xml中

后续:对于Android Studio的使用看来还是不是太熟悉,还是要多学习学习。

 

Android Studio 轻松整理字符串到string.xml中

相关文章:

  • 2021-09-23
  • 2021-11-20
  • 2022-01-05
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2021-11-14
猜你喜欢
  • 2021-10-06
  • 2021-04-01
  • 2021-05-28
  • 2021-06-16
  • 2021-12-02
  • 2021-04-22
  • 2021-10-29
相关资源
相似解决方案