android.view.InflateException:二进制XML文件第9行:膨胀类com.jjoe64.graphview.helper.GraphViewXML时出错 [英] android.view.InflateException: Binary XML file line #9: Error inflating class com.jjoe64.graphview.helper.GraphViewXML

查看:63
本文介绍了android.view.InflateException:二进制XML文件第9行:膨胀类com.jjoe64.graphview.helper.GraphViewXML时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Android模拟器上启动我的图形应用程序.一直弹出不幸的图形停止".有人可以帮我解决这个问题吗?

I have trouble getting my graph app to start on the Android emulator. "Unfortunately graph stopped" keeps on popping up. Can somebody help me fix this?

这是Java文件:

package graphs.com.graphs;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivityG extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_activity_g);
    }


     @Override
      public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main_activity_g, menu);
        return true;
    }

    @Override
     public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

这是我的XML文件:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/lib/graphs.com.graphs"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivityG">

    <com.jjoe64.graphview.helper.GraphViewXML
        android:layout_width="match_parent"
        android:layout_height="100dip"
        app:seriesData="0=5;2=5;3=0;4=2" />

</RelativeLayout>

推荐答案

您尝试替换

xmlns:app="http://schemas.android.com/apk/lib/graphs.com.graphs"

通过

xmlns:app="http://schemas.android.com/apk/res-auto"

不知道它是否可以解决

这篇关于android.view.InflateException:二进制XML文件第9行:膨胀类com.jjoe64.graphview.helper.GraphViewXML时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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