Alexei
Alexei

Reputation: 15656

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?

Upvotes: 6

Views: 871

Answers (1)

mightyWOZ
mightyWOZ

Reputation: 8315

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

Upvotes: 1

Related Questions