Morteza Rastgoo Morteza Rastgoo - 1 month ago 5
Android Question

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?

Answer

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