android.view.InflateException:二进制XML文件,6号线:错误充气类<&不明GT; [英] android.view.InflateException: Binary XML file line #6: Error inflating class <unknown>

查看:125
本文介绍了android.view.InflateException:二进制XML文件,6号线:错误充气类<&不明GT;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的机器人。
    我收到错误的android.view.InflateException:二进制XML文件,6号线:错误充气类。此前这项活动运行良好。但突然收到此错误。清理项目这么多次。但是,没有工作。

I am new to android. I am getting the error as android.view.InflateException: Binary XML file line #6: Error inflating class . Earlier this activity was running fine. But suddenly getting this error. Cleaned the project so many times. But didn't work.

XML布局是:

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".FragDownloadSites" >

    <ExpandableListView
        android:id="@+id/lvDownloadSite"
        android:layout_width="fill_parent"
        android:layout_height="610dp"
        android:layout_x="0dp"
        android:layout_y="70dp" >
    </ExpandableListView>

    <TextView
        android:id="@+id/tvDownloadSiteMessage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_x="30dp"
        android:layout_y="21dp"
        android:text="Downloaded Sites"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <ImageButton
        android:id="@+id/btnDownloadSite"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_x="540dp"
        android:layout_y="10dp"
        android:src="@drawable/refresh" />

</AbsoluteLayout>

和code是:

package com.example.config;

import android.support.v4.app.Fragment;


public class FragDownloadSites extends Fragment implements SiteDataInterface {
    View rootView;
    ExpandableListView expListView;
    TextView tvMsg;
    ProgressDialog progress;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.frag_download_sites, container, false);

        progress = new ProgressDialog(rootView.getContext());
        progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progress.setCancelable(false);
        progress.setMessage("Loading...");

        tvMsg=(TextView)rootView.findViewById(R.id.tvDownloadSiteMessage);

        // get the listview
        expListView = (ExpandableListView)rootView.findViewById(R.id.lvDownloadSite);
        DisplaySiteData();

        return rootView;
    }

先谢谢了。

推荐答案

这个类是API级别3 pcated德$ P $。
使用的FrameLayout,RelativeLayout的或自定义布局来代替。

This class was deprecated in API level 3. Use FrameLayout, RelativeLayout or a custom layout instead.

也绝对布局不够灵活,更难保持比其他类型的布局和
绝对定位是不是在不同的屏幕分辨率和宽高比的世界太多有用的。

also Absolute layouts are less flexible and harder to maintain than other types of layouts and absolute positioning is not too much useful in world of various screen resolutions and aspect ratios.

所以你请使用其他布局。
也许这个答案帮助ü...

so you please use other layout. may this answer help u...

感谢

这篇关于android.view.InflateException:二进制XML文件,6号线:错误充气类&LT;&不明GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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