0

I would like to set up a dialog box in my fragment class. I have done this before with normal activity class, but not with fragment.

I am following this answer HERE that someone has already answered, but I'm getting an error. Will that answer work within a fragment?

I am wanting to open the dialog on image click that I have set up already from an ImageView.

Any help would be great, thanks in advanace.

I would like the dialog code to go:

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    final View v = inflater.inflate(R.layout.image_detail_fragment,
            container, false);

    mImageView = (RecyclingImageView) v.findViewById(R.id.imageView);
    mImageView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {



          /HERE




        }

    });

    return v;
}
4

1 回答 1

0

If you are using fragments then you should be using DialogFragments instead of the old Dialog box.

http://developer.android.com/reference/android/app/DialogFragment.html

于 2013-10-08T14:22:20.307 回答