question

quypham avatar image
quypham asked

Error when using MapView in Fragment

Hi all, currently i use MapView in XML file to display Amazon Map in my fragment but when i try to run it,the following error happens. Can you guys tell me what happen here and how can i fix it? Thanks My code: mMapView = (MapView) contentView.findViewById(R.id.ss_mapViewPost); mMapView.onCreate(savedInstanceState); mMapView.onResume(); My Mapview XMl: Here are the log cat: java.lang.IllegalStateException: Must call onAttach on DebugFragment before calling getContext. at com.amazon.client.framework.acf.module.ModuleFragmentContextManager.getContext(ModuleFragmentContextManager.java:81) at com.amazon.client.framework.acf.module.ModuleFragmentContextManager.getLayoutInflater(ModuleFragmentContextManager.java:89) at com.amazon.geo.client.renderer.MapContextLifecycle.getInflater(MapContextLifecycle.java:209) at com.amazon.geo.client.renderer.MapContextLifecycle.createView(MapContextLifecycle.java:83) at com.amazon.geo.client.renderer.MapEngineFactoryImpl.createMapControlView(MapEngineFactoryImpl.java:103) at com.amazon.geo.mapsv2.MapView.initMapView(MapView.java:152) at com.amazon.geo.mapsv2.MapView.onCreate(MapView.java:212) at com.directv.common.ui.dtvuisecondscreen.location.LocationDialogFragmentPost.onCreateView(LocationDialogFragmentPost.java:216) at android.app.Fragment.performCreateView(Fragment.java:1700) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062) at android.app.BackStackRecord.run(BackStackRecord.java:684) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:443) at android.os.Handler.handleCallback(Handler.java:755) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5266) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:826) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:642)
amazon maps
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers