错误充气PreferenceActivity中的复选框 [英] Error inflating checkbox in PreferenceActivity

查看:130
本文介绍了错误充气PreferenceActivity中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的pref_general.xml文件有一些问题,因为我收到以下错误信息:


android.view.InflateException :二进制XML文件行#19:错误充气类android.widget.CheckBox


然后logcat指向我的PreferenceActivity中的行调用addPreferencesFromResource(R.xml.pref_general);



经过几个小时的尝试,我仍然不知道这是什么问题,所以也许有人熟悉

pref_general.xml:




 < PreferenceScreen xmlns:android =http://schemas.android.com/apk/res/ android> 

< PreferenceCategory
android:title =General>
<! - < SwitchPreference
android:key =NOTIF
android:title =Activer ou désactiver les notifications/> - >
< CheckBoxPreference
android:defaultValue =true
android:key =NOTIF
android:title =Activer /Désactiverles notifications/>

< Preference
android:key =cache
android:title =Vider le cache/>


< Preference
android:key =FAQ
android:title =FAQ
android:summary =Questionsfréquentes
/>
< Preference
android:key =feedback
android:title =FeedBack
android:summary =S'il vousplaîtenvoyer nous un FeedBack
/>
< Preference
android:key =version
android:title =Version
android:summary =1.0.0(Build A750)
/>
< Preference
android:key =Copyright
android:title =Copyright
android:summary =Toutes lesmatièrescontenues sur ce site sontProtégéespar Nextice Inc ,droit d'auteur et ne peuvent pasétrereproduits,distribués,transmis,affichés,publiéesoudiffuséssans l'premissionécritpréalablede lasociétéNextice。
android:selectable =true
android:enabled =false
/>

< / PreferenceCategory>
< / PreferenceScreen>

此外,我试图在Android 5.1 everyting是罚款,但在api 19电话)没有工作?


SettingsActivity:



$ b b

  public class SettingsActivity extends PreferenceActivity {

CheckBoxPreference notification;

@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_general);


LinearLayout root =(LinearLayout)findViewById(android.R.id.list).getParent()。getParent()。getParent();
工具栏bar =(工具栏)LayoutInflater.from(this).inflate(R.layout.settings,root,false);
root.addView(bar,0); // insert at top
bar.setNavigationOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent intent = new Intent(SettingsActivity。 this,MainActivity.class);
startActivity(intent);
finish();
}
});



SharedPreferences settingsPrefs = PreferenceManager.getDefaultSharedPreferences(this);
notification =(CheckBoxPreference)findPreference(NOTIF);
notification.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){

public boolean onPreferenceChange(偏好偏好,
Object newValue){
if(newValue.toString()。equals true))
{
notificationsOn();
//PushService.setDefaultPushCallback(getApplicationContext(),MainActivity.class);
//PushService.subscribe(getApplicationContext ,null,MainActivity.class,R.drawable.ic_notification);

}
else
{
notificationsOff();
//PushService.setDefaultPushCallback (getApplicationContext(),null);
//PushService.unsubscribe(getApplicationContext(),null);
//PushService.unsubscribe(getApplicationContext(),);
}
return true;
}

private void notificationsOn(){
// TODO自动生成的方法存根
/*Toast.makeText(SettingsActivity.this, 通知:Activée,Toast.LENGTH_SHORT).show();
PushService.setDefaultPushCallback(getApplicationContext(),MainActivity.class);
Pushbots.sharedInstance()。setNotificationEnabled(true); * /

}

private void notificationsOff(){
// TODO方法stub
/*Toast.makeText(SettingsActivity.this,Notifications:Desactivée,Toast.LENGTH_SHORT).show();
PushService.setDefaultPushCallback(getApplicationContext(),null);
Pushbots.sharedInstance()。setNotificationEnabled(false); * /

}

});



偏好myPref =(偏好)findPreference(feedback);
myPref.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(Preference preference){

Intent emailIntent = new Intent(Intent.ACTION_SENDTO,Uri.fromParts(
mailto,feedback@soft-grip-support.esy.es,null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT,Votre Sujet);
emailIntent.putExtra .EXTRA_TEXT,Votre FeedBack(Texte));
startActivity(Intent.createChooser(emailIntent,Envoyer emailà));

return false;
$ b b}
});

偏好ver =(偏好)findPreference(version);
ver.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(偏好偏好){

Toast.makeText(SettingsActivity.this,1.0.0(Build A750) ,Toast.LENGTH_LONG).show();

return false;

}
});

偏好缓存=(首选项)findPreference(cache);
cache.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(偏好偏好){


deleteCache(SettingsActivity.this);
Toast。 makeText(SettingsActivity.this,CacheVidée,Toast.LENGTH_LONG).show();

return false;

}
}

偏好faq =(首选项)findPreference(FAQ);
faq.setOnPreferenceClickListener(new OnPreferenceClickListener(){

@Override
public boolean onPreferenceClick(Preference arg0){

String url =www.soft -grip.net/faq;
Intent intent = new Intent(SettingsActivity.this,ActivityWebView.class);
intent.putExtra(share,url);
startActivity ;


/ * String url =http://www.google.com;
Intent i = new Intent(Intent.ACTION_VIEW);
i .setData(Uri.parse(url));
startActivity(i); * /

return false;
}
}

偏好fb =(首选项)findPreference(fb);
fb.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(Preference preference){

try {
Intent intent = new Intent(Intent.ACTION_VIEW,Uri .parse(fb:// page / 503359346436234));
startActivity(intent);
} catch(Exception e){
startActivity(Intent.ACTION_VIEW,Uri。 parse(https://www.facebook.com/Soft.Grip.Inc));
}

return false;

}
});

偏好twt =(首选项)findPreference(twt);
twt.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(Preference preference){

Intent intent = null;
try {
//如果可能,获得Twitter应用程序
getPackageManager()。getPackageInfo(com.twitter.android,0);
intent = new Intent(Intent.ACTION_VIEW,Uri.parse(twitter:// user ?user_id = 1588577185));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} catch(Exception e){
//没有Twitter应用程序,恢复浏览器
intent = new Intent(Intent.ACTION_VIEW,Uri.parse(https://twitter.com/SoftGripInc));
}
startActivity(intent);

return false ;

}
});

偏好sms =(首选项)findPreference(sms);
sms.setOnPreferenceClickListener(new OnPreferenceClickListener(){

@Override
public boolean onPreferenceClick(Preference arg0){

Intent sendIntent = new Intent 。
sendIntent.putExtra(sms_body,smsBody);
sendIntent.setType(vnd.android-dir / mms-sms);
startActivity(sendIntent) ;

return false;
}
});

偏好http =(首选项)findPreference(http);
http.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(Preference preference){

String url =http://www.soft-grip.net;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

return false ;

}
});

偏好merci =(偏好)findPreference(deve);
merci.setOnPreferenceClickListener(new OnPreferenceClickListener(){
public boolean onPreferenceClick(Preference preference){

ShowDialog(SettingsActivity.this,Merci,Merci d'utiliser l'应用软夹子!\\\
Developpeur:Soft Grip Inc. \\\
Tous les droitsréservés。\\\
Soft-Grip Inc©2015,false);
return false;

}




public void ShowDialog(Context context,String title,String message,Boolean status){
AlertDialog alertDialog = new AlertDialog.Builder(context)。 create();

//设置对话框标题
alertDialog.setTitle(null);

//设置对话框消息
alertDialog.setMessage );

//设置警告对话框图标
// alertDialog.setIcon((status)?R.drawable.success:R.drawable.fail);

//设置OK按钮
alertDialog.setButton(OK,new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog,int which){


}
});

//显示提醒消息
alertDialog.show();

}
});


}

public static void deleteCache(Context context){
try {
File dir = context.getCacheDir();
if(dir!= null& dir.isDirectory()){
deleteDir(dir);
}
} catch(Exception e){}
}

public static boolean deleteDir(File dir){
if(dir! ;& dir.isDirectory()){
String [] children = dir.list();
for(int i = 0; i boolean success = deleteDir(new File(dir,children [i]));
if(!success){
return false;
}
}
}
return dir.elete();
}




Logcat:




  android.view.InflateException:二进制XML文件行#19: widget.CheckBox 
at android.view.LayoutInflater.createView(LayoutInflater.java:627)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
在android.view.LayoutInflater.onCreateView(LayoutInflater.java:676)
在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:701)
在android.view.LayoutInflater.inflate(LayoutInflater。 java:470)
在android.view.LayoutInflater.inflate(LayoutInflater.java:398)
在android.view.LayoutInflater.inflate(LayoutInflater.java:354)
在android.preference .Preference.onCreateView(Preference.java:531)
在android.preference.Preference.getView(Preference.java:494)
在android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:222)
在android.widget.AbsListView.obtainView(AbsListView.java:2351)
在android.widget.ListView.makeAndAddView(ListView.java:1816)
在android.widget.ListView.fillDown ListView.java:697)
在android.widget.ListView.fillFromTop(ListView.java:763)
在android.widget.ListView.layoutChildren(ListView.java:1646)
在android .widget.AbsListView.onLayout(AbsListView.java:2207)
at android.view.View.layout(View.java:15033)
在android.view.ViewGroup.layout(ViewGroup.java:4799 )
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
在android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
在android.widget.LinearLayout。 onLayout(LinearLayout.java:1443)
在android.view.View.layout(View.java:15033)
在android.view.ViewGroup.layout(ViewGroup.java:4799)
在android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
在android.widget.LinearLayout.layoutHorizo​​ntal(LinearLayout.java:1677)
在android.widget.LinearLayout.onLayout(LinearLayout.java :1445)
在android.view.View.layout(View.java:15033)
在android.view.ViewGroup.layout(ViewGroup.java:4799)
在android.widget。 LinearLayout.setChildFrame(LinearLayout.java:1692)
在android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
在android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
at android.view.View.layout(View.java:15033)
在android.view.ViewGroup.layout(ViewGroup.java:4799)
在android.widget.FrameLayout.layoutChildren(FrameLayout .java:453)
在android.widget.FrameLayout.onLayout(FrameLayout.java:388)
在android.view.View.layout(View.java:15033)
在android。 view.ViewGroup.layout(ViewGroup.java:4799)
在android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
在android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
在android.view.View.layout(View.java:15033)
在android.view.ViewGroup.layout (ViewGroup.java:4799)
在android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
在android.widget.FrameLayout.onLayout(FrameLayout.java:388)
android.view.View.layout(View.java:15033)
在android.view.ViewGroup.layout(ViewGroup.java:4799)
在android.view.ViewRootImpl.performLayout(ViewRootImpl.java: 2143)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1854)
在android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
在android.view.ViewRootImpl $ TraversalRunnable.run(ViewRootImpl.java:5998)
在android.view.Choreographer $ CallbackRecord.run(Choreographer.java:761)
在android.view.Choreographer.doCallbacks(Choreographer.java:574 )
at android.view.Choreographer.doFrame(Choreographer.java:544)
在android.view.Choreographer $ FrameDisplayEventReceiver.run(Choreographer.java:747)
在android.os。 Handler.handleCallback(Handler.java:733)
在android.os.Handler.dispatchMessage(Handler.java:95)
在android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
在java.lang.reflect.Method.invokeNative(本地方法)
在java.lang.reflect.Method.invoke( Method.java:515)
at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1280)
at com.android.into


解决方案

有一个 23.2.0 中的android / issues / detail?id = 201817rel =nofollow p>

这在库的修订版 23.2.1 中修复。此修订说明了以下我认为是问题的根本原因,并解释为什么它只在运行API 19的手机上失败:


修复了在API
级别17到19的DrawableCompat.wrap()和LayerDrawable中的异常。



I'm having some issue with my pref_general.xml file as I get the following error message:

android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox

Then the logcat points the line in my PreferenceActivity where I call "addPreferencesFromResource(R.xml.pref_general);"

After several hours of trying to sort it out I still have no idea what the issue is so maybe someone is familiar with this or simply another set of eyes can find the problem.

pref_general.xml:

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

<PreferenceCategory
    android:title="General">
    <!--  <SwitchPreference
        android:key="NOTIF"
        android:title="Activer ou dأ©sactiver les notifications" /> -->
    <CheckBoxPreference
    android:defaultValue="true"
    android:key="NOTIF"
    android:title="Activer/Désactiver les notifications" />

    <Preference
        android:key="cache"
        android:title="Vider le cache"/>


    <Preference
        android:key="FAQ"
        android:title="FAQ"
        android:summary="Questions fréquentes"
        />
    <Preference
        android:key="feedback"
        android:title="FeedBack"
        android:summary="S'il vous plaît envoyer nous un FeedBack"
        />
    <Preference
        android:key="version"
        android:title="Version"
        android:summary="1.0.0(Build A750)"
        />
    <Preference
        android:key="Copyright"
        android:title="Copyright"
        android:summary="Toutes les matières contenues sur ce site sont Protégées par Nextice Inc, droit d'auteur et ne peuvent pas étre reproduits, distribués, transmis, affichés, publiأés ou diffusés sans l'premission écrit préalable de la société Nextice."
        android:selectable="true"
        android:enabled="false"
        />

    </PreferenceCategory>
 </PreferenceScreen>

Also, i'm trying this in Android 5.1 everyting is fine, but in api 19 ( in my phone ) nothing working ?

SettingsActivity:

public class SettingsActivity extends PreferenceActivity {

CheckBoxPreference notification;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.pref_general);


    LinearLayout root = (LinearLayout)findViewById(android.R.id.list).getParent().getParent().getParent();
    Toolbar bar = (Toolbar) LayoutInflater.from(this).inflate(R.layout.settings, root, false);
    root.addView(bar, 0); // insert at top
    bar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(SettingsActivity.this, MainActivity.class);
            startActivity(intent);
            finish();
        }
    });



    SharedPreferences settingsPrefs = PreferenceManager.getDefaultSharedPreferences(this);
    notification = (CheckBoxPreference) findPreference("NOTIF");
    notification.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){

        public boolean onPreferenceChange(Preference preference,
                Object newValue) {
            if (newValue.toString().equals("true"))
            {
                notificationsOn();
                //PushService.setDefaultPushCallback(getApplicationContext(), MainActivity.class);
                //PushService.subscribe(getApplicationContext(), null, MainActivity.class, R.drawable.ic_notification);

            }
            else
            {
                notificationsOff();
                //PushService.setDefaultPushCallback(getApplicationContext(), null);
                //PushService.unsubscribe(getApplicationContext(), null);
                //PushService.unsubscribe(getApplicationContext(), "");
            }
            return true;
        }

        private void notificationsOn() {
            // TODO Auto-generated method stub
            /*Toast.makeText(SettingsActivity.this, "Notifications: Activée", Toast.LENGTH_SHORT).show();
            PushService.setDefaultPushCallback(getApplicationContext(), MainActivity.class);
            Pushbots.sharedInstance().setNotificationEnabled(true);*/

        }

        private void notificationsOff() {
            // TODO Auto-generated method stub
            /*Toast.makeText(SettingsActivity.this, "Notifications: Desactivée", Toast.LENGTH_SHORT).show();
            PushService.setDefaultPushCallback(getApplicationContext(), null);
            Pushbots.sharedInstance().setNotificationEnabled(false);*/

        }

    });



    Preference myPref = (Preference) findPreference("feedback");
    myPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {

            Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
                    "mailto", "feedback@soft-grip-support.esy.es", null));
            emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Votre Sujet");
            emailIntent.putExtra(Intent.EXTRA_TEXT, "Votre FeedBack (Texte)");
            startActivity(Intent.createChooser(emailIntent, "Envoyer email à"));

            return false;

        }
    });

    Preference ver =  (Preference) findPreference("version");
    ver.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {

         Toast.makeText(SettingsActivity.this, "1.0.0(Build A750)", Toast.LENGTH_LONG).show();

            return false;

        }
    });

    Preference cache =  (Preference) findPreference("cache");
    cache.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {


            deleteCache(SettingsActivity.this);
            Toast.makeText(SettingsActivity.this, "Cache Vidée", Toast.LENGTH_LONG).show();

            return false;

        }
    });

    Preference faq = (Preference)findPreference("FAQ");
    faq.setOnPreferenceClickListener(new OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference arg0) {

            String url = "www.soft-grip.net/faq";
            Intent intent = new Intent(SettingsActivity.this, ActivityWebView.class);
            intent.putExtra("share", url);
            startActivity(intent);


            /*String url = "http://www.google.com";
            Intent i = new Intent(Intent.ACTION_VIEW);
            i.setData(Uri.parse(url));
            startActivity(i);*/

            return false;
        }
    });

    Preference fb =  (Preference) findPreference("fb");
    fb.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {

            try {
                Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/503359346436234"));
                startActivity(intent);
            } catch(Exception e) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/Soft.Grip.Inc")));
            }

            return false;

        }
    });

    Preference twt =  (Preference) findPreference("twt");
    twt.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {

            Intent intent = null;
            try {
                // get the Twitter app if possible
                getPackageManager().getPackageInfo("com.twitter.android", 0);
                intent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?user_id=1588577185"));
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            } catch (Exception e) {
                // no Twitter app, revert to browser
                intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/SoftGripInc"));
            }
            startActivity(intent);

            return false;

        }
    });

    Preference sms = (Preference)findPreference("sms");
    sms.setOnPreferenceClickListener(new OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference arg0) {

            Intent sendIntent= new Intent(Intent.ACTION_VIEW);
            sendIntent.putExtra("sms_body", "smsBody");
            sendIntent.setType("vnd.android-dir/mms-sms");
            startActivity(sendIntent);

            return false;
        }
    });

    Preference http =  (Preference) findPreference("http");
    http.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {

            String url = "http://www.soft-grip.net";
            Intent i = new Intent(Intent.ACTION_VIEW);
            i.setData(Uri.parse(url));
            startActivity(i);

            return false;

        }
    });

    Preference merci =  (Preference) findPreference("deve");
    merci.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {

            ShowDialog(SettingsActivity.this, "Merci", "Merci d'utiliser l'App Soft Grip!\nDéveloppeur : Soft Grip Inc. \nTous les droits réservés. \nSoft-Grip Inc © 2015 ", false);
            return false;

        }




        public void ShowDialog(Context context, String title, String message, Boolean status) {
    AlertDialog alertDialog = new AlertDialog.Builder(context).create();

    // Setting Dialog Title
    alertDialog.setTitle(null);

    // Setting Dialog Message
    alertDialog.setMessage(message);

    // Setting alert dialog icon
//  alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail);

    // Setting OK Button
    alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {


        }
    });

    // Showing Alert Message
    alertDialog.show();

}
    });


}

public static void deleteCache(Context context) {
    try {
        File dir = context.getCacheDir();
        if (dir != null && dir.isDirectory()) {
            deleteDir(dir);
        }
    } catch (Exception e) {}
}

public static boolean deleteDir(File dir) {
    if (dir != null && dir.isDirectory()) {
        String[] children = dir.list();
        for (int i = 0; i < children.length; i++) {
            boolean success = deleteDir(new File(dir, children[i]));
            if (!success) {
                return false;
            }
        }
    }
    return dir.delete();
}

Logcat:

android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox
    at android.view.LayoutInflater.createView(LayoutInflater.java:627)
    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:676)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:701)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:470)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
    at android.preference.Preference.onCreateView(Preference.java:531)
    at android.preference.Preference.getView(Preference.java:494)
    at android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:222)
    at android.widget.AbsListView.obtainView(AbsListView.java:2351)
    at android.widget.ListView.makeAndAddView(ListView.java:1816)
    at android.widget.ListView.fillDown(ListView.java:697)
    at android.widget.ListView.fillFromTop(ListView.java:763)
    at android.widget.ListView.layoutChildren(ListView.java:1646)
    at android.widget.AbsListView.onLayout(AbsListView.java:2207)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
    at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1677)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1445)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1692)
    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1534)
    at android.widget.LinearLayout.onLayout(LinearLayout.java:1443)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
    at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
    at android.view.View.layout(View.java:15033)
    at android.view.ViewGroup.layout(ViewGroup.java:4799)
    at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2143)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1854)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1062)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5998)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
    at android.view.Choreographer.doCallbacks(Choreographer.java:574)
    at android.view.Choreographer.doFrame(Choreographer.java:544)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5590)
    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:1280)
    at com.android.into

解决方案

There is a bug in version 23.2.0 of the support library that can cause this.

This was fixed in revision 23.2.1 of the library. This revision states the following which I believe was the root cause of the issue and explains why it only failed on your phone running API 19:

Fixed an exception in DrawableCompat.wrap() and LayerDrawable on API levels 17 to 19.

这篇关于错误充气PreferenceActivity中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆