TeeChart (JavaAndroid 2012)教程示例导致UnsupportedOperationExcepti



我正在尝试通过他们的教程(第一个)中的一个例子来工作。由于某种原因,当我运行下面的代码时,它会导致发生UnsupportedOperationException。谁能提供任何帮助,为什么会发生这种情况?

以下是相关文件。

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.teeChart02"
          android:versionCode="1"
          android:versionName="1.0">
    <uses-sdk android:minSdkVersion="15"/>
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name="MyActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>

main。xml

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:id="@+id/mylayout">
</LinearLayout>

MyActivity.java

package com.example.teeChart02;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import com.steema.teechart.TChart;
import com.steema.teechart.drawing.Color;
import com.steema.teechart.styles.Bar;
import com.steema.teechart.styles.Series;
public class MyActivity extends Activity
{
    private TChart chart;
    @Override
    public void onCreate( Bundle savedInstanceState )
    {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.main );
        LinearLayout ll = (LinearLayout) findViewById( R.id.mylayout );
        chart = new TChart( this );
        ll.addView( chart );
        Series bar = new Bar( chart.getChart() );
        chart.getAxes().getBottom().setIncrement( 1 );
        bar.add( 123, "Apples", Color.green );
        bar.add( 456, "Oranges", Color.red );
        bar.add( 321, "Kiwis", Color.yellow );
        bar.add( 78, "Bananas", Color.orange );
    }
}

生成的异常为:

01-17 11:50:27.863: ERROR/AndroidRuntime(1631): FATAL EXCEPTION: main
        java.lang.UnsupportedOperationException
        at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:413)
        at com.steema.teechart.android.Graphics3DAndroid.clipPolygon(Graphics3DAndroid.java:312)
        at com.steema.teechart.drawing.Graphics3D.clipToRight(Graphics3D.java:4575)
        at com.steema.teechart.drawing.Graphics3D.clipCube(Graphics3D.java:4614)
        at com.steema.teechart.styles.Series.clipRegionCreate(Series.java:2088)
        at com.steema.teechart.styles.Series.drawSeries(Series.java:2311)
        at com.steema.teechart.Chart.drawAllSeries(Chart.java:790)
        at com.steema.teechart.Chart.drawAxesSeries(Chart.java:752)
        at com.steema.teechart.Chart.internalDraw(Chart.java:732)
        at com.steema.teechart.Chart.paint(Chart.java:2080)
        at com.steema.teechart.Chart.paint(Chart.java:2096)
        at com.steema.teechart.TChart.onDraw(TChart.java:322)
        at android.view.View.draw(View.java:10978)
        at android.view.View.getDisplayList(View.java:10417)
        at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
        at android.view.View.getDisplayList(View.java:10415)
        at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
        at android.view.View.getDisplayList(View.java:10415)
        at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
        at android.view.View.getDisplayList(View.java:10415)
        at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
        at android.view.View.draw(View.java:10981)
        at android.widget.FrameLayout.draw(FrameLayout.java:450)
        at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2126)
        at android.view.View.getDisplayList(View.java:10417)
        at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:842)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:1910)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1634)
        at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4424)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
        at dalvik.system.NativeStart.main(Native Method)

请检查您是否在"Project properties -> Java Build Path -> Order and Export"选项卡中选择了teecchart . android .jar库

我使用minSdkVersion为11,目标为13的TeeChart工作得很好。当我切换到minSdkVersion为12,目标为15时,我开始收到完全相同的错误。我还没有花时间找出问题所在,但只要我切换回11和13,问题就解决了

相关内容

  • 没有找到相关文章

最新更新