AndroidStudio怎么通过putExtra传输过来的类数据进行换行

我想要将传输过来的数据
按照我想要的进行换行图片说明图片说明

   public void onClick(View v) {
        //从文本框中获取用户名,存入到strname中
        String strname = edt_name.getText().toString();
        if (strname.length() < 3 || strname.length() > 20)
            edt_name.setError("请输入正确的用户名,用户名 在3-20个字符之间");
        String password = edt_password.getText().toString();//获取第一次密码
        if (password.equals("") || password.equals("")) {
            edt_password.setError("密码不能为空");
        } else if (password.equals(password)) {
            Toast.makeText(this, "注册成功", Toast.LENGTH_LONG).show();


            person Person = new person();
            Person.setUsername(edt_name.getText().toString());
            Person.setUser_phonenumber(edt_phonenumber.getText().toString());
            Person.setUser_email(edt_email.getText().toString());
            Person.setUser_password(edt_password.getText().toString());
            Intent intent = new Intent(this, UserActivity.class);
            intent.putExtra("userinfor", Person);
            startActivity(intent);
        }

    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
        tv_person=findViewById(R.id.tv_userInfor);
        Intent intent=getIntent();
        person Person1 = (person) intent.getSerializableExtra("userinfor");
        String personstr;
        personstr= Person1.getUsername() +Person1.getUser_email() +Person1.getUser_password() +Person1.getUser_phonenumber() ;
        tv_person.setText(personstr);
    }


public class person implements Serializable {
    private String username;
    private String user_password;
    private String user_email;
    private String user_phonenumber;

    public void setUsername(String name){
        this.username = name;
    }

    public String getUsername() { return username;
    }

    public String getUser_password() {
        return user_password;
    }

    public void setUser_password(String user_password) {
        this.user_password = user_password;
    }

    public String getUser_email() {
        return user_email;
    }

    public void setUser_email(String user_email) {
        this.user_email = user_email;
    }

    public String getUser_phonenumber() {
        return user_phonenumber;
    }

    public void setUser_phonenumber(String user_phonenumber) {
        this.user_phonenumber = user_phonenumber;
    }


    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="#ff00ff"
        android:id="@+id/tv_userInfor"
        android:textSize="20dp"
        android:textStyle="bold"
        />

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问