How can I insert overridePendingTransition
on a GridView
`Adapter? In this way don't work, without transition startactivity work perfectly
bt.setOnLongClickListener(new OnLongClickListener(){
@Override
public boolean onLongClick(View v) {
final String selectedPad = Drum.pads[position];
Intent modPad = new Intent(v.getContext(), ModifyPad.class);
modPad.putExtra("pad", selectedPad);
context.startActivity(modPad);
overridePendingTransition(R.anim.exit_slid_in, R.anim.exit_slid_out);
return false;
}
});
I've read this post:
android start Activity in adapter (transition animiation direction problem), and comments related, but I don't know how pass the Activity
in the Adapter
. Any help?
Context is the Base Object of Activity ( see: What is the difference between Activity and Context? ), so I used following:
Activity activity = (Activity) mContext;
activity.startActivity(repinIntent);
activity.overridePendingTransition(R.anim.act_start_in_from_right, R.anim.act_start_out_to_left);
Refers to: Getting activity from context in android
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