Android : Fragment manager error

on Saturday, March 21, 2015


I have this problem. I want to pass data from one fragment to another. I've seen tutorial, but when I do it:



public void SendData(String position,String id)
{
FragmentManager manager = getFragmentManager();
Map map = (Map)manager.findFragmentById(R.id.mapView); //error here
}


I read this error:



Inconvertible types; cannot cast 'android.app.Fragment' to 'com.example.mypc.task.map'



how could I do? this is activity_maps.xml:



<?xml version="1.0" encoding="utf-8"?> <com.google.android.gms.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mapView" android:layout_width="match_parent" android:layout_height="match_parent" />



thank you for your answers...


0 comments:

Post a Comment