dear friends,
can any one guide me what mistake am i doing in this code??? it not seems to be working..
i have two activies
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent(DataPassing.this, DataPassing2.class);
Bundle b = new Bundle();
b.putInt("key", 1123);
intent.putExtras(b);
startActivity(intent);
finish();
}
and in second activity i have written
public void onCreate(Bundle savedInstanceState) {
Bundle b = getIntent().getExtras();
int value = b.getInt("key", 0);
Toast.makeText(this, value, Toast.LENGTH_SHORT).show();
}
but the code is giving me error i dont know why.. i have added second activity to manifest file.. please guide what mistake i am doing ???
any help would be appriciated..