robd
robd

Reputation: 9825

Stop Intellij / Android Studio Preview adding newlines when formatting anonymous inner class parameters

I'm trying to stop Android Studio Preview (ie IntelliJ) from adding in a newline / carriage return after an anonymous inner class when it's defined as a method parameter. It changes this:

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

to this:

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

I've looked through the formatting settings, but can't seem to find the relevant setting.

Upvotes: 2

Views: 614

Answers (1)

Eugen Martynov
Eugen Martynov

Reputation: 20130

Check out these options:

enter image description here

Let me know if it doesn't work for you

Upvotes: 4

Related Questions