I am trying to write an Android app in Java. In Android Studio, I go to
File->Settings->Editor->Code Style->Java
Then for Project, I modify the curly braces (I can't read code with unaligned curly braces), click apply, and finally click OK.
But then I reopen the settings to find that my settings have been discarded and it has reverted my code style.
How do I prevent it from reformatting to a different style?
I'm not sure if I undestand properly your question but I think that you want to put "Braces" in the next line, isn't it?
You must edit at:
File->Settings->Editor->Code Style->Java
Then,
Select Project or Default -> Wrapping and Braces -> Braces Placement -> NextLine
Let me know if works? For me, it is working fine:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.