Code generation shortcut

0

I would like to know if there is any functionality in Android Studio where I type a word and the IDE inserts an add-in (NOTE: In that I reported this, not the IDE itself). Example:

buttonobj -> Button btnexemplo = (Button) findViewById(R.id.btnexemplo);

When you type buttonobj + SPACE it would insert:

Button btnexemplo = (Button) findViewById(R.id.btnexemplo);

Is there such a feature in NetBeans, could anyone tell me if there is in Android Studio? And where do I set this up?

    
asked by anonymous 28.10.2018 / 15:46

1 answer

0

The name of this is Live Templates (fyk, in visual studio is snippets). To view / edit / add your live templates, go to Files > Settings > Editor > Live Templates chooses what you want (android, for example). To add a new one just click on the greenest symbol on the side. To insert a live template into the code, just click the menu in Code > Insert Live Template or CTRL + J

Edit: Partial response in SOen

    
28.10.2018 / 20:34