samedi 29 mars 2014

method getSupportFragmentManager () is undefined for the type CadastroModoVoo


Vote count:

0




I'm trying to create a DatePicker within a fragment and returns the error The method getSupportFragmentManager () is undefined for the type CadastroModoVoo. What is wrong?


XML



<Button
android:id="@+id/selectHora3Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:onClick="selectHora3"
android:text="Hora" />


CLASS public class CadastroModoVoo extends Fragment { private FragmentActivity context;


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



cadastro_modo_voo = inflater.inflate(R.layout.cadastro_modo_voo, container, false);
context = getActivity();



@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SuppressLint({ "ValidFragment", "NewApi" })
public void selectHora3(View view) {
qual = 3;
DialogFragment newFragment = new SelectTimeFragment();
newFragment.show(getSupportFragmentManager(), "TimePicker"); -----> error
}


asked 59 secs ago






Aucun commentaire:

Enregistrer un commentaire