Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Member variable prefix ("m") in getters and setters in Android studio 1.1

How do I configure Android Studio "v 1.1" to correctly generate getters and setters for member variables with prefixes and not to generate getters like: getmName() and instead generate getName()?

I've looked at many questions like : Intellij (Android studio) member variable prefix, but it seems to be removed in "Version 1.1"

Am i right?

like image 951
Morteza Rastgoo Avatar asked May 06 '15 07:05

Morteza Rastgoo


2 Answers

in preferences -> code style -> java you'll find the tab code generation. There you will find a matrix of text box, where you can define prefix and suffix for field, static field, parameter and local variable. Enter m for the pair (Name Prefix, Field) and it should work

enter image description here

like image 81
Blackbelt Avatar answered Oct 02 '22 12:10

Blackbelt


Editor->Code Style->Java, then last tab 'Code Generation'

write m in field's 'Name Prefix' column.

like image 35
Muzaffer Avatar answered Oct 02 '22 13:10

Muzaffer