holder.close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
onBackPressed();
}
}) ;
return convertView;
}
if your previous activity is on stack just call -
((Activity) mContext).finish();
else call previous activity using intent & finish current activity.
holder.close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent mIntent=new Intent(mContext,MyActivity.class);
mContext.startActivity(mIntent);
((Activity) mContext).finish();
}
}) ;
return convertView;
}
You can write code in Activity's onBackPressed() method for going to previous activity,and then give call to activity's onBackPressed() method from adapter.
((Your Activity)context).onBackPressed();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With