This is my part of a code.when i click the button"play" i need to take it to the previous activity which is the main activity.Have tried this code but this is not working.Iam new to android ..Plz help.Thanks in advance!!
Button play;
case R.id.playid:
Intent i = getIntent();
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
startActivity(new Intent(this, MainActivity.class));
}