Félix Desjardins
Félix Desjardins

Reputation: 3223

Shortcut to quickly create/modify string in Android Studio without using strings.xml?

I searched on the web on how to modify or create a string in Android Studio, but didn't find any information on shortcuts.

I just want to modify the @string/app_name from Basic App to My app for example.

I know that I can manually navigate to strings.xml to achieve this, but is there a faster method via shortcut?

Upvotes: 5

Views: 6899

Answers (3)

btm me
btm me

Reputation: 653

One more option is there with plugin type

Android: Automatic string extraction

link string extractor plugin

**<!-- Before, Layout: example.xml -->
<TextView
  android:id="@+id/textView"
  android:text="Hardcoded value"
  />

<!-- After -->
<TextView
  android:id="@+id/textView"
  android:text="@string/example_textView_text"
  />**

you can try this, and for elaboration see this post.

Upvotes: 0

Piotr
Piotr

Reputation: 3970

In Android Studio

  1. to rename string either file

WINDOWS Ctrl + F6

MAC fn + Shift + F6

  1. "extract string resource" to create new string under file resources/string

WINDOWS Alt + Enter

MAC Alt + Enter

I also encourage you guys to see this video which shows some other trick, you may use in order to speed up your programming.

Upvotes: 9

stkent
stkent

Reputation: 20128

Using Mac 10.5+ shortcuts, highlighting a symbol (e.g. method, reference to a resource) and pressing Command+B will take you directly to where that symbol is defined.

On Windows it's Ctrl+B.

Upvotes: 2

Related Questions