📜  显示来自适配器的对话框片段 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:30.143000             🧑  作者: Mango

代码示例1
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");
      }
}