I am unable to understand when to use these methods
Button b = (Button) findViewById(R.id.btn);
home.setOnClickListener (new View.OnClickListener() {
public void onClick(View view) {
Intent i = new Intent(view.getContext(), Home.class);
startActivityForResult (i, 0);
}
});
and
Button b = (Button)findViewById(R.id.btn);
button.setOnClickListener (new View.OnClickListener() {
public void onClick (View view) {
Intent i = new Intent (this, Home.class);
startActivity (i);
}
});
and
my other doubt is when i start an new Activity using intent onCreate(Bundle b) method is called and i want to know whether the b(Bundle) refers to current Activity or the the previous Activity the one which is called.