Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- save.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- FILENAME = filename.getText().toString();
- COMMENTS = comments.getText().toString();
- try {
- FileOutputStream f = openFileOutput(FILENAME,
- Context.MODE_PRIVATE);
- f.write(COMMENTS.getBytes());
- f.close();
- Toast.makeText(getBaseContext(),
- "Saved",
- Toast.LENGTH_SHORT).show();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
Add Comment
Please, Sign In to add comment