0

I have an application that works fine in Android 4.1.2 but on Android 4.2.2 I get the following error:

https://gist.github.com/hanleyhansen/ed3a81067638de6136e3

This is my WorkspaceMod.java file:

https://gist.github.com/hanleyhansen/e32eab4c0e8845658133

Any ideas why this class isn't working? The NPE is not too enlightening.

hanleyhansen
  • 6,304
  • 8
  • 37
  • 73
  • I would check to see if there's children first. The only way that can get a null pointer exception on line 917 is if `getChildAt(getChildCount() - 1)` returns `null`. The only way this could happen is if child count is 0, though it seems like you'd get a different exception. – DeeV May 29 '13 at 02:36
  • @DeeV why would it be a problem only on 4.2.2 and not 4.2.1? Did exception handling change? – hanleyhansen May 29 '13 at 02:41
  • I don't know exactly. Android has weird quirks like that. There's nothing that pops out to me from what you showed. It could be that whatever method you're using to add children simply isn't getting called so no children are being added. – DeeV May 29 '13 at 10:45

1 Answers1

0

The issue was not related to ViewGroup specifically but to android drawable. See my new question here for more info.

Community
  • 1
  • 1
hanleyhansen
  • 6,304
  • 8
  • 37
  • 73