Android Null Pointer Exception
Hi guys I´ve tried to connect two different interfaces on my app with the following code

public class HelloForms extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
       final ImageButton button = (ImageButton) findViewById(R.id.android_button);
        button.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //Perform action on clicks
            	
            	setContentView(R.layout.secon);
                //Toast.makeText(HelloForms.this, "Beep Bop", Toast.LENGTH_SHORT).show();
            }
       });
        
         Button buttonReg = (Button) findViewById(R.id.android_secon);
        buttonReg.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //Perform action on clicks
            	setContentView(R.layout.main);
                //Toast.makeText(HelloForms.this, "Beep Bop", Toast.LENGTH_SHORT).show();
            }
       });
        
        final EditText edittext = (EditText) findViewById(R.id.edittext);
        edittext.setOnKeyListener(new OnKeyListener() {
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
                  // Perform action on key press
                  Toast.makeText(HelloForms.this, edittext.getText(), Toast.LENGTH_SHORT).show();
                  return true;
                }
                return false;
            }
        });
    }
}

when I run the simulation Eclipse throws a [2011-05-10 07:57:48 - ddms]null
java.lang.NullPointerException
	at com.android.ddmlib.Client.sendAndConsume(Client.java:572)
	at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142) 

so I do not know what I´m doing wrong
Android Null Pointer Exception
===

Hi guys I´ve tried to connect two different interfaces on my app with the following code

public class HelloForms extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
       final ImageButton button = (ImageButton) findViewById(R.id.android_button);
        button.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //Perform action on clicks
            	
            	setContentView(R.layout.secon);
                //Toast.makeText(HelloForms.this, "Beep Bop", Toast.LENGTH_SHORT).show();
            }
       });
        
         Button buttonReg = (Button) findViewById(R.id.android_secon);
        buttonReg.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //Perform action on clicks
            	setContentView(R.layout.main);
                //Toast.makeText(HelloForms.this, "Beep Bop", Toast.LENGTH_SHORT).show();
            }
       });
        
        final EditText edittext = (EditText) findViewById(R.id.edittext);
        edittext.setOnKeyListener(new OnKeyListener() {
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
                  // Perform action on key press
                  Toast.makeText(HelloForms.this, edittext.getText(), Toast.LENGTH_SHORT).show();
                  return true;
                }
                return false;
            }
        });
    }
}

when I run the simulation Eclipse throws a [2011-05-10 07:57:48 - ddms]null
java.lang.NullPointerException
	at com.android.ddmlib.Client.sendAndConsume(Client.java:572)
	at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142) 

so I do not know what I´m doing wrong