I'm still having issues. I'm using the honeycombgallery sample from the android site and am tring to remove the ImageView fragment (that shows the image in the bottom right) and replace it with a AFragmentMapActivity.
The samples Main uses multiple fragments and I would like to continue doing that but with the replacement of one of them to a AFragmentMapActivity. The sample works if i have the mainactivity extend from AFragmentActivity and leave all original fragments in place but when I try to extend from AFragmentMapActivity and replace the ImageView fragment with a MapActivity AFragmentMapActivity I can't get things to work. Would you have any pointers as to how I could change the code to make this example work? On Apr 30, 6:04 pm, Streets Of Boston <[email protected]> wrote: > The new contents of FragmentActivity.java are in my earlier post. > > The AFragmentActivity.java is a copy of the original FragmentActivity.java > with these additional changes: > > - public class AFragmentActivity extends Activity *implements > FragmentActivity* > - Then fix the compiler errors from the change above (i.e. implement > missing methods that are defined by the FragmentActivity). This is pretty > trivial. > > The AFragmentMapActivity is a copy of the AFragmentActivity with these > additional changes: > > - public abstract class AFragmentMapActivity extends *Map*Activity > implements FragmentActivity > > Then you'll find that other source files in the compatibility have some > compiler errors. These are trivial to fix. Mostly adding (Context) or > (Activity) casts and calling '.getFragments()' instead of '.mFragments' and > such. > > Here is a usage example: > *public class Main extends AFragmentMapActivity { > > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > }* > * @Override > protected boolean isRouteDisplayed() { > return false; > } > > }* > > *public class MapFragment extends Fragment { > private View fragmentView; > private MapView mapView;* > * > @Override > public View onCreateView(LayoutInflater inflater, ViewGroup container, > Bundle savedInstanceState) { > fragmentView = inflater.inflate(R.layout.map, container, false); > mapView = (MapView)fragmentView.findViewById(R.id.mapview); > > return fragmentView; > }* > *}* > > And the layout main.xml has a <fragment> in there that refers to * > MapFragment*. > * > > * > > - > - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

