Android Question NullPointerException - ViewGroup

rafaelbr20

Member
Licensed User
Longtime User
Hi Everyone,

I´m having this exception when my activity is open. This activity is a Puzzle Game and when i´m using it this exception occurs.

My activity code is too long to post here. I didn´t find on log where it occurs.

Please, someone can help me ?

Thanks so Much


java.lang.NullPointerException
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2572)
at android.view.View.draw(View.java:11018)
at android.view.ViewGroup.drawChild(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2573)
at android.view.View.draw(View.java:11018)
at android.widget.FrameLayout.draw(FrameLayout.java:450)
at android.view.ViewGroup.drawChild(ViewGroup.java:2971)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2573)
at android.view.ViewGroup.drawChild(ViewGroup.java:2969)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2573)
at android.view.View.draw(View.java:11018)
at android.widget.FrameLayout.draw(FrameLayout.java:450)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2147)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2218)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1787)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2642)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4624)
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:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
 

DonManfred

Expert
Licensed User
Longtime User
It is better to export your project as zip and upload that file here instad of just the activity-code.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
If you don't want to upload your project, generate with debug and it should tell you the Basic4Android statement line number where the error occurred. It's probably the use of a variable which doesn't get initialized due to first time issues.

Without the code it's hard to help you.
 
Upvote 0

rafaelbr20

Member
Licensed User
Longtime User
If you don't want to upload your project, generate with debug and it should tell you the Basic4Android statement line number where the error occurred. It's probably the use of a variable which doesn't get initialized due to first time issues.

Without the code it's hard to help you.


It is better to export your project as zip and upload that file here instad of just the activity-code.


Hi DonManfred and Eps,

Thanks for your reply !

I´m uploading my activity and the classes that it uses.

The error occurs when i´m not doing anything , i leave the activity open and after about 50 seconds the error occurs ! I´m suspect about some listener.

Some of the Puzzle Game code i got from Informatix Code, here http://www.b4x.com/android/forum/threads/comment-font-ils-4.21446/#post123994


Thanks so Much !

Rafael
 

Attachments

  • PuzzleGameActivity.zip
    19.7 KB · Views: 281
Upvote 0

eps

Expert
Licensed User
Longtime User
Sorry had a meeting all afternoon.

I'll try and take a look, but I've got something I _have_ to finish tonight.

Again, I would countenance generating the code with trace and then B4A will show you where the error occurred in the code. If it's not in your code, then at least you'll be able to see that as well.
 
Upvote 0

rafaelbr20

Member
Licensed User
Longtime User
Sorry had a meeting all afternoon.

I'll try and take a look, but I've got something I _have_ to finish tonight.

Again, I would countenance generating the code with trace and then B4A will show you where the error occurred in the code. If it's not in your code, then at least you'll be able to see that as well.


Hi Eps,

I found the problem ! Was in the Admob banner, i have a Timer to show and hide it, and when i comment these lines the problem gone !

Thanks so much for your help !!

Rafael
 
  • Like
Reactions: eps
Upvote 0
Top