IllegalArgumentException in Android

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
investsoft
Newbie
Newbie
Posts: 5
Joined: Mon Mar 05, 2012 12:00 am

IllegalArgumentException in Android

Post by investsoft » Thu May 10, 2012 9:18 am

Hi.
I have noticed a strange behavior of the chart on Android app.
When touching the chart with the palm of my hand I get a force close dialog because of an IllegalArgumentException.

I was able to reproduce this behavior on your example app that I downloaded from the Google Play store (I sent a report).

What is the cause for this? Is it going to be fixed, or is there a good workaround for this?

Meanwhile I have set a touch listener that passes the call to the chart's onTouch() and surrounded that call with try/catch:

Code: Select all

chart.setOnTouchListener(new View.OnTouchListener() {
	@Override
	public boolean onTouch(View v, MotionEvent event) {
		try {
			// IllegalArgumentException thrown here when touching the chart with the palm of the hand
			// surrounding it with try/catch so the app doesn't crash...
			chart.onTouch(v,event);
		} catch (IllegalArgumentException e) {
			Log.e(TAG, e.printStackTrace());
		}
	}
});
Thanks,
Meir, Investsoft

Exception message:
historyPos out of range. Stack trace: java.lang.IllegalArgumentException: historyPos out of range
at android.view.MotionEvent.nativeGetAxisValue(Native Method)
at android.view.MotionEvent.getHistoricalX(MotionEvent.java:2268)
at com.steema.teechart.TChart.onTouch(TChart.java:1119)
at android.view.View.dispatchTouchEvent(View.java:5536)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
at android.view.View.dispatchPointerEvent(View.java:5721)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:859)
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)

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IllegalArgumentException in Android

Post by Yeray » Fri May 11, 2012 3:24 pm

Hi Meir,
investsoft wrote:I have noticed a strange behavior of the chart on Android app.
When touching the chart with the palm of my hand I get a force close dialog because of an IllegalArgumentException.

I was able to reproduce this behavior on your example app that I downloaded from the Google Play store (I sent a report).
I'm not able to reproduce it with the app downloaded from the play store and my Galaxy Mini. Maybe my screen is too small. In what device(s) have you tried it? If more than one, did you reproduce the problem in all of them?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

investsoft
Newbie
Newbie
Posts: 5
Joined: Mon Mar 05, 2012 12:00 am

Re: IllegalArgumentException in Android

Post by investsoft » Wed May 16, 2012 7:42 am

Hi Yeray,
I did try this on more then one device.
It was reproduced on 2 out of 6 devices. In these 2 devices it will happen every time I try.

Reproduced on (and reports were sent to you):
Samsung Nexus S (small screen).
Motorola Xoom (tablet).

Did not happen on:
Samsung Galaxy S2.
Sony Ericsson Xperia LT18i.
Samsung tablet GT-P7510.
Asus Transformer Prime TF201.

I will love to know of any thing you find.
Thanks,
Meir

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IllegalArgumentException in Android

Post by Yeray » Thu May 17, 2012 3:36 pm

Hi Meir,

We haven't been able to reproduce the problem so far.
We'll try it with as many devices as possible, but it would be helpful if you could precise a little bit more:
- Does it happen in one concrete example?
- Do you/we need to touch the screen just a moment or should we push some time, move the palm of the hand around the screen, or some other special movement?
- What Android versions do your devices run?

Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: IllegalArgumentException in Android

Post by Narcís » Fri Nov 15, 2013 9:28 am

Hi Meir,

Another customer came up with some more information about this issue, see this thread. We haven't been able to reproduce the problem ourselves yet. However, I have submitted the issue (ID103) to our bug tracking platform. If you sign up to it please let us know, we will be glad to add you to the CC List so that you can be notified about updates on the issue.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply