Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SaveText(View view)
- {
- File CS_File = new File(this.getExternalFilesDir(null), "BLUH.txt");
- CS_File.mkdirs();
- try {
- CS_File.createNewFile();
- FileWriter CS_FileWriter = new FileWriter(CS_File);
- EditText CS_EditText = (EditText)findViewById(R.id.createscreen_edittext);
- String CS_MessageTemp = CS_EditText.getText().toString();
- CS_FileWriter.write(CS_MessageTemp);
- CS_FileWriter.close();
- }
- catch (IOException e) {
- Log.w("WriteFile", "Error writing" + CS_File, e);
- }
- TextView CS_TestText = (TextView)findViewById(R.id.createscreen_testtext);
- CS_TestText.setText(CS_File.toString());
- }
- public void LoadText(View view)
- {
- File CS_File = new File(this.getExternalFilesDir(null), "BLUH.txt");
- String CS_Message = "";
- try {
- FileInputStream CS_FileInputS = new FileInputStream(CS_File);
- CS_FileInputS.read(CS_Message.getBytes(), 0, CS_Message.length());
- CS_FileInputS.close();
- } catch (IOException e) {
- Log.w("LoadFile", "Error loading" + CS_File, e);
- }
- Intent INT_DisplayScreen = new Intent(this, ACT_DisplayScreen.class);
- INT_DisplayScreen.putExtra(EXTRA_MESSAGE, CS_Message);
- startActivity(INT_DisplayScreen);
- }
Advertisement
Add Comment
Please, Sign In to add comment