简体   繁体   中英

Combining text in 2 EditText into one file.txt in internal storage

Im trying to make a card like this.

Name:
Message:
To:

And i want to save it in 1 file like.txt into my internal storage. This is the example picture.
在此处输入图像描述

I try this code. writeTofile(edt_txt + txtme.getText().toString()); but didnt work only one EditText is working to save in file. Help me please. Im newbie here.

This is my code below:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    requestPermissions(new String[] {WRITE_EXTERNAL_STORAGE,READ_EXTERNAL_STORAGE},1);
}

init();
btn_save.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        writeToFile(edt_text + txtme.getText().toString());
    }
});

writeToFile(edt_text + txtme.getText().toString(),your another edit tex); You need to pass two string parameter to your writeToFile() function. Add your writeToFile code too.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM