Error in Log: pastebin.com/YLvmkAd4
FragmentSettings.class:
package com.android.app;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.PreferenceFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class FragmentSettings extends PreferenceFragment {
[..]
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mListPreference = (ListPreference) getPreferenceManager().findPreference("preference_key");
return inflater.inflate(R.layout.activity_main, container, false);
}
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar_actionbar"
layout="@layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:clickable="true"
android:layout_height="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>
</FrameLayout>
</LinearLayout>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<com.android.app.ScrimInsetsFrameLayout
android:id="@+id/scrimInsetsFrameLayout"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:layout_gravity="start"
app:insetForeground="#4000"
android:elevation="10dp">
<fragment
android:id="@+id/fragment_drawer"
android:name="com.android.app.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout="@layout/fragment_navigation_drawer" />
</com.android.app.ScrimInsetsFrameLayout>
</android.support.v4.widget.DrawerLayout>
Devices:
Oppo N1, Android 4.2.2
Samsung Galaxy Note 1, Android 5.1.1
I've spent now hours and hours for this error and couldn't find it. The clue is that exactly the same app is working perfectly on Android 5.1.1.
Additional:
MainActivity.java pastebin.com/a2NZLZFm
NavigationDrawerFragment.java pastebin.com/PqTMiPp3
fragment_navigation_drawer.xml pastebin.com/eVeAdv17