我正在使用Android Plot jar文件示例实现图表应用程序。。它显示应用程序在Jar文件的com.androidplot.xy.XYPlot
上运行。但是,当我在配置项目后尝试时,它显示错误为,。。
Could not find class 'com.androidplot.xy.XYPlot', referenced from method com.androidplot.xy.SimpleXYPlotActivity.onCreate
帮我找到解决方案。。。
我的xml代码是,。。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.androidplot.xy.XYPlot
android:id="@+id/mySimpleXYPlot"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="10px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
title="A Simple XYPlot Example"/>
</LinearLayout>
通常这意味着你要么在项目的/libs目录中没有androidplot jar,要么如果你使用的是像IntelliJ或Eclipse这样的带有ADT的IDE,你还没有明确地将jar添加到类路径中。
此外,如果您使用Androidplot 0.5.1或更高版本,则需要更改此行:
title="A Simple XYPlot Example"
至
androidPlot.title="A Simple XYPlot Example"