I use the fragmentActivity function for maps.In the Java class gets an error when setting setContentView. My Mapscreen.java is similar: it works fine on some devices showing crash only on marshmallows. Or is there another reason?
public class MapScreen extends FragmentActivity implements LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_screen); .... SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); googleMap = fm.getMap(); } and my xml has fragment using SupportMapFragment as well. map_screen.xml is like : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" /> <ImageView android:id="@+id/startActivityButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginLeft="50dp" android:layout_marginRight="50dp" android:layout_marginBottom="44dp" android:background="@drawable/end_meetup_btn" /> </RelativeLayout>
I cannot find the same question. Getting a crash here in Marshmallow: "Binary line of XML file # 7: Error inflating a class fragment" Please suggest! I tried to find "Caused: java.lang.NullPointerException: attempt to also call the virtual method" boolean java.io.File.mkdir () "in the reference to the null object."
12-18 13:40:14.425: E/AndroidRuntime(8026): FATAL EXCEPTION: main 12-18 13:40:14.425: E/AndroidRuntime(8026): Process: com.kindlebit.urban_exchange, PID: 8026 12-18 13:40:14.425: E/AndroidRuntime(8026): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kindlebit.urban_exchange/com.kindlebit.urban_exchange.MapScreen}: android.view.InflateException: Binary XML file line
android google-maps android-fragmentactivity
Heena arora
source share