Discussion Forums  >  Crashes, Memory Warnings

Replies: 3    Views: 130

Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
09/15/12 12:48 PM (11 years ago)

Crash when i use Driving Directions in Android.

(BT 2.0 Self Hosted) Hi guys!, im having this Crash error's in the Developers console: Both errors with: Class: java.lang.NullPointerException Metod: BT_viewUtilities.updateBackgroundColorsForScreen() Error 1: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mendozaallin/com.mendozaallin.BT_screen_menuButtons}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) 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:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.mendozaallin.BT_viewUtilities.updateBackgroundColorsForScreen(BT_viewUtilities.java:40) at com.mendozaallin.BT_screen_menuButtons.onCreate(BT_screen_menuButtons.java:123) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) ... 11 more Error 2: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mendozaallin/com.mendozaallin.BT_screen_map}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) at android.app.ActivityThread.access$1500(ActivityThread.java:117) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3687) 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:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.mendozaallin.BT_viewUtilities.updateBackgroundColorsForScreen(BT_viewUtilities.java:40) at com.mendozaallin.BT_screen_map.onCreate(BT_screen_map.java:184) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) ... 11 more When i test the app, when i use the Driving directions, i choose the Google Maps and when try to go back to the App, the app crash. i Don't use any Background color, only Background image "img.jpg". Any ideas? Tnks!
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
09/16/12 08:59 PM (11 years ago)
UP!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/18/12 06:33 PM (11 years ago)
Not sure if you ever got this figured out or not? We've been struggling with it for sometime. After downloading your project, find BT_viewUtilities.java in your projects /src directory. Replace updateBackgroundColorsForScreen updateBackgroundColorsForScreen method with this method. See if it fixes it? //updates a screens background color... public static void updateBackgroundColorsForScreen(final Activity theActivity, final BT_item theScreenData){ BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen with nickname: \"" + theScreenData.getItemNickname() + "\""); //will hold background color... String backgroundColor = ""; RelativeLayout backgroundSolidColorView = null; try{ //global theme is used if screen does not have a setting BT_item theThemeData = daviddebug_appDelegate.rootApp.getRootTheme(); //reference to background color relative layout in act_base.xml (this layout file is used by all the plugins)... backgroundSolidColorView = (RelativeLayout) theActivity.findViewById(R.id.backgroundSolidColorView); //solid background color if(BT_strings.getJsonPropertyValue(theScreenData.getJsonObject(), "backgroundColor", "").length() > 1){ backgroundColor = BT_strings.getJsonPropertyValue(theScreenData.getJsonObject(), "backgroundColor", ""); }else{ backgroundColor = BT_strings.getJsonPropertyValue(theThemeData.getJsonObject(), "backgroundColor", ""); } }catch (Exception e){ BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen: EXCEPTION (1) " + e.toString()); } try{ if(backgroundColor.length() > 5 && backgroundSolidColorView != null){ BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen: setting background color to: \"" + backgroundColor + "\""); try{ if(backgroundColor.equalsIgnoreCase("clear")){ backgroundSolidColorView.setBackgroundColor(Color.TRANSPARENT); backgroundSolidColorView.setVisibility(0); }else{ backgroundSolidColorView.setBackgroundColor(BT_color.getColorFromHexString(backgroundColor)); backgroundSolidColorView.setVisibility(1); } backgroundSolidColorView.invalidate(); }catch(Exception e){ BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen: Exception setting background color (\"" + backgroundColor + "\") " + e.toString()); } } }catch (Exception e){ BT_debugger.showIt(objectName + ":updateBackgroundColorsForScreen: EXCEPTION (2)" + e.toString()); } }
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
10/19/12 02:10 PM (11 years ago)
Thank you very much for your help, I tested and it worked very well!!
 

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.