Android : Cannot set OnClick for a button inside a TAB

on Friday, April 17, 2015


Kindly help.I am new to android TABS. I want my button to take me to a new page when it is clicked on. Currently I am trying to implement the same method as I used to.



public class PhotosActivity extends Activity {
private Button btnRegularRecrutor;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.photos_layout);
btnRegularRecrutor = (Button) findViewById(R.id.RegularRecruters);

btnRegularRecrutor.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {

// TODO Auto-generated method stub
Intent A = new Intent(MainActivity.this, RegularRecruters.class);

startActivity(A);

}
});
}
}


The button should take me to RegularRecruters.class. Thanks in advance


0 comments:

Post a Comment