Discussion Forums  >  Crashes, Memory Warnings

Replies: 4    Views: 357

Rishav
Code is Art
Profile
Posts: 153
Reg: Jan 26, 2012
Dubai
8,780
Fourm StarFourm Star
06/20/13 04:42 AM (9 years ago)

java.lang.NullPointerException

Any solution for this yet.. I am seeing this kind of errors for more then a year.. According to me the this is beacuse android kills the activity so the refrence object is lost but i want to know what if we place a code in the on pause method to save the object with relp of shared refrence and retrive it when app resumes. Here is log cat report of the error in my app. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rjapp/com.rjapp.BT_screen_menuButtons}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675) at android.app.ActivityThread.access$1500(ActivityThread.java:121) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:138) at android.app.ActivityThread.main(ActivityThread.java:3701) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.rjapp.BT_viewUtilities.updateBackgroundColorsForScreen(BT_viewUtilities.java:67) at com.rjapp.BT_screen_menuButtons.onCreate(BT_screen_menuButtons.java:122) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623) ... 11 more
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
Fourm StarFourm StarFourm Star
like
06/20/13 11:02 AM (9 years ago)
from the log cat details it seems that there is something wrong in the menu button plugin. check whether you have put correct code of the background color of that screen. for eg- #000000 for white. it should be # plus six digit (or alphabetic) code. i think you are missing something here.
 
Rishav
Code is Art
Profile
Posts: 153
Reg: Jan 26, 2012
Dubai
8,780
Fourm StarFourm Star
like
06/20/13 11:27 AM (9 years ago)
All the colour codes are correct in my App. The coulour feature works great. This is the log from my playstore crash section. only 12 reports for 500users...so only some face the issue. Though even i faced it today so i posted it.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
Fourm StarFourm StarFourm Star
like
06/20/13 11:37 AM (9 years ago)
Will have to check what the code is on line 122 of BT_screen_menuButtons.java plugin file.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
Fourm StarFourm StarFourm Star
like
06/20/13 11:39 AM (9 years ago)
line 67 in bt_viewUtilities is debug code (well, it is in mine - I don't think I've made any changes to that file..), you could just comment that out. Not sure about line 122 of BT_screen_menuButtons as I've got loads of code changes - it could be debug code too?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.