Android application null error while debugging on tablet

view story

http://stackoverflow.com – My application works fine on an emulator but when i run it on tablet. I get nullpointer exception. What would be the problem?? And here is an example code public class Giris extends Activity{ Button giris; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); giris= (Button) findViewById(R.id.button1); giris.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); } } EDI (HowTos)