包装和大括号在android studio

时间:2019-04-16 12:04:39

标签: android-studio code-formatting

我没有成功弄清楚如何包装这些物品。例如,我有这个:

new AlertDialog.Builder(this).setTitle("Preferences").setMessage(
            "user name: " + username + "\n" + "bio: " + bio + "\n" + "image: " + image + "\n" +
            "notification: " + notif).show();

但是我想要这个:

 new AlertDialog.Builder(this)
            .setTitle("Preferences")
            .setMessage("user name: " + username + "\n" +
                        "bio: " + bio +"\n" +
                        "image: "+ image +"\n"+
                        "notification: "+ notif)
            .show();

0 个答案:

没有答案