Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setTargetFragment for android.support.v4.app.Fragment?

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?

like image 870
The Nomad Avatar asked Jun 03 '14 06:06

The Nomad


1 Answers

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

like image 109
Rod_Algonquin Avatar answered Nov 01 '22 15:11

Rod_Algonquin