Stop Intellij / Android Studio Preview by adding new lines when formatting the parameters of an anonymous inner class

I am trying to stop viewing Android Studio (i.e. IntelliJ) from adding to a new line / carriage return after an anonymous inner class when it is defined as a method parameter. He changes this:

runOnUiThread(new Runnable() {
    @Override
    public void run() {
        //Some code
    }
});

:

runOnUiThread(new Runnable() {
    @Override
    public void run() {
        //Some code
    }
}
);

I looked at the formatting options but cannot find a suitable setting.

+2
source share
1 answer

Check these options:

enter image description here

Let me know if this does not work for you

+4
source

Source: https://habr.com/ru/post/1523654/


All Articles