Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void zapisz(View view){
- String dane= String.valueOf(((EditText)findViewById(R.id.editText)).getText());
- try {
- FileOutputStream fOut = openFileOutput("file",MODE_WORLD_READABLE);
- fOut.write(dane.getBytes());
- fOut.close();
- Toast.makeText(getApplicationContext(),"UDALO SIE",Toast.LENGTH_SHORT).show();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- public void wczytaj(View view){
- try{
- FileInputStream fin = openFileInput("file");
- int c;
- String temp="";
- while( (c = fin.read()) != -1){
- temp = temp + Character.toString((char)c);
- }
- fin.close();
- ((TextView)findViewById(R.id.loaded)).setText(temp);
- Toast.makeText(getApplicationContext(),"UDALO SIE",Toast.LENGTH_SHORT).show();
- }catch(Exception e) {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement