gpt4 book ai didi

android - 多次单击图 TableView 会导致应用崩溃

转载 作者:行者123 更新时间:2023-12-03 17:26:53 25 4
gpt4 key购买 nike

我正在使用图表 View 作为显示结果 View 。如果我在图表 View 上单击多次,则该应用程序将崩溃。如何防止用户在图表 View 上多次单击。

private View getSpeedChartView(final FtpResult result, final boolean isDownload, final boolean useMbps) {
AbstractChart chart = getSpeedChart(result, isDownload, useMbps,
createXYMultipleSeriesRenderer(isDownload, useMbps, false));
if (chart == null) {
return null;
}

View view = new GraphicalView(mActivity, chart);
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mActivity.startActivity(new Intent(mActivity, GraphicalActivity.class)
.putExtra(ChartFactory.CHART,
getSpeedChart(result, isDownload, useMbps,
createXYMultipleSeriesRenderer(
isDownload, useMbps, true)))
.putExtra(ChartFactory.TITLE, (String) null));
}
});
return view;
}

private AbstractChart getSpeedChart(FtpResult result, boolean isDownload,
boolean useMbps, XYMultipleSeriesRenderer renderer) {
if (mConfig.iterations == 1) {
return result.iterations.size() > 0 ?
getSpeedTimeChart(result.iterations.get(0),
isDownload, useMbps, renderer) : null;
}
}

这是我的堆栈跟踪报告:
STACK_TRACE=java.lang.NullPointerException
at org.achartengine.chart.XYChart.toRealPoint(XYChart.java:805)
at org.achartengine.tools.Pan.apply(Pan.java:74)
at org.achartengine.TouchHandler.handleTouch(TouchHandler.java:126)
at org.achartengine.GraphicalView.onTouchEvent(GraphicalView.java:286)
at android.view.View.dispatchTouchEvent(View.java:7143)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1949)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1949)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2244)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1949)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1938)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1392)
at android.app.Activity.dispatchTouchEvent(Activity.java:2408)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1886)
at android.view.View.dispatchPointerEvent(View.java:7323)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3560)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3490)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4637)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4597)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4749)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:125)
at android.os.Looper.loop(Looper.java:140)
at android.app.ActivityThread.main(ActivityThread.java:5000)
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:821)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)

最佳答案

已在我的程序中升级到新的jar文件。现在没有发生此问题。
链接是Visit(https://code.google.com/p/achartengine/downloads/list)!

关于android - 多次单击图 TableView 会导致应用崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26312573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com