I am working on a CustomListView
for a fragment and CustomAdapter
extends from BaseAdapter
. In my CustomAdapter
there is button on click that button i want to move a activity but i don't know how to switch from one fragment to an activity.
Try this:
private void moveToNewActivity () {
Intent i = new Intent(getActivity(), DetailActivity.class);
startActivity(i);
((Activity) getActivity()).overridePendingTransition(0, 0);
}
overridePendingTransition(0,0);
means no Animation in transition.
Check This, it will give you a fair idea of how an onClickListener is used to start a new Activity, from within a Fragment.
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