I am trying to pass info from a DialogFragment
to it's hosting Fragment
, but the problem is I am using the android.support.v4.app.Fragment
instead of the regular android.app.Fragment
package for my Fragments
.
This code gives me an error:
messageResponseDialog.setTargetFragment(this, 0);
setTargetFragment
is expecting a Fragment
and not a support.v4.Fragment
.
How can I do implement a callback from the DialogFragment to the hosting Fragment using the android.support.v4.app.Fragment?
You are trying to set a target fragment from a DialogFragment
that is not from the android.support
solution:
change your DialogFragment to android.support
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.