Tasos Paterakis

Greenhorn
+ Follow
since May 24, 2019
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tasos Paterakis

Perfect, it's all clear now. I'll opt for performing a null check, as you suggested. Once again, thanks
1 year ago
Thanks for the tip. Am I right to assume that the following will have the same result? If so, then perhaps this indeed will be the best approach. Though it's impossible to know why the exception is thrown in the first place, at least this will maintain functionality. Thanks for your help, I appreciate it!

1 year ago
Thank you both for your prompt replies - glad to be here!

Stephan, it shouldn't be possible for the drag to start from another activity. Here are some further details about the code (I tried to omit any non-pertinent parts, let me know if I've left something out)




And Tim, you're absolutely right. This issue shows up 3-4 times a week, for a total number of 10.000+ users. So the numbers are clearly in favor of the code - as you said, you just know that such NPEs shouldn't happen. So, ultimately, it doesn't really affect my app - but it's an interesting puzzle nonetheless!
1 year ago
Hi,

I'm puzzled by the following issue for weeks now. Any input or ideas would be appreciated.

I'm implementing a dragListener in a fragment as the code below shows:



The implementation works on my test devices and for the vast majority of users. However, Google Console notifies me about some users (all running Android 5.0 or Android 6.0, if that's important) having a NullPointerException on line 9, dropped.post(new Runnable(){

I feel at loss about this. For the life of me, I can't understand why the TextView dropped (apparently the culprit) would not be defined - to clarify, the dragListener is possible only on TextViews, therefore View view = (View) event.getLocalState(); can only be a TextView. May I again emphasize that this is only for some users; as I said the code words for the overwhelming majority of users.

It's hard for me to troubleshoot the error, as it seems to only affect a relatively small number of users (and I can't personally replicate it). I wonder whether it's somehow related to something in the native Java code of Android 5.0 and 6.0.

Since this particular DragEvent is only about changing the visibility of the TextView, I could plausibly surround it with a try/catch, but I don't wanna do that without knowing what's the problem - I'm afraid it might propagate further down, to other DragEvents that are much more critical.

Any ideas what could be the source of this error, or what else I could try?
If you need more details or code, I'd be happy to provide more context.

PS.
Here's the logcat - though it doesn't really provide any insights (to me at least)


1 year ago