Answers for "Open dialog fragment from adapter"

2

show dialog fragment from adapter

public class YourPagerAdapter extends PagerAdapter{

   private Context context;

   public YourPagerAdapter(Context c) {
          this.context = c;
   }

   @Override
      public void onClick(View v) {
            FragmentActivity activity = (FragmentActivity)(context);
            FragmentManager fm = activity.getSupportFragmentManager();
            YourDialogFragment alertDialog = new YourDialogFragment();
            alertDialog.show(fm, "fragment_alert");
      }
}
Posted by: Guest on December-27-2020

Code answers related to "Open dialog fragment from adapter"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language