All pastes #2058600 Raw Edit

Someone

public text v1 · immutable
#2058600 ·published 2011-05-13 22:55 UTC
rendered paste body
package com.russell.saw;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.content.Intent;
import java.io.File;
import java.io.IOException;



public class Noted extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        	File myDir=new File("/sdcard/notes");
        	myDir.mkdirs();
        	File myFile=new File("/sdcard/notes/FileOut.txt");
        	try {
        	    if(myFile.createNewFile()) {
        	        System.out.println("File already exists");
        	    } 
        	} catch (IOException ex) {
        	    System.out.println(ex);
        	}

    
        	
        
   Button notes_button = (Button) findViewById(R.id.notes_button); {
	   notes_button.setOnClickListener(
			   new View.OnClickListener() {
			public void onClick(View view) {
					Intent myIntent = new Intent(view.getContext(), notetaker.class);
	                startActivityForResult(myIntent, 0);
	         }});}
   


    Button viewsaved = (Button) findViewById(R.id.viewsaved); {
    	      
    	       
 	   viewsaved.setOnClickListener(
 			   
 			   new View.OnClickListener() {
 				
 			public void onClick(View view) {
 					Intent myIntent2 = new Intent(view.getContext(), savednotes.class);
 	                startActivityForResult(myIntent2, 1);
 	                
 				}
 			
 			});
    }

        }
            
   

    

}