I would like to have an activity which would consist of a close button i.e \'x\' at the right top corner closing the activity. Any examples on this will be very much helpful
Use juzt have an x like image at the right top of corner. By pressing x image u can finish the activity.
XML:
In Java Code:
ImageView view=(ImageView)findViewById(R.id.close);
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent=new Intent(currentclass.this,statingclass.class);
startActivity(intent);// here u can start another activity or just call finish method to close the activity.
finish();
}
});