Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio. How to change template for generating "toString()" method?

Android Studio 2.3.

Following is the default template for toString() method

enter image description here

How can I change this template?

like image 411
Alexei Avatar asked Jun 07 '17 13:06

Alexei


1 Answers

You can not change the default template, but you can add your custom template and use that instead of default.

Follow these steps to add a new template.

  1. Press (Alt+Insert) or Go to Code -> Generate and select toString() from the contextual menu: This will open following window

    enter image description here

  2. In the opened dialog box, click on the Settings button on top right corner. a new dialog box will open with two tabs(Settings and Templates).

  3. Select the Templates tab and it will show following dialog.

    Templates Tab

  4. Use the + sign on top left corner to define your own template

like image 69
mightyWOZ Avatar answered Sep 25 '22 13:09

mightyWOZ