Discussion Forums  >  Status Bar, Navigation Bar

Replies: 5    Views: 111

LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
12/30/12 01:58 PM (11 years ago)

Android Code

I am trying to connect my App to the control panel. I've successfully done all the coding but the Navigation Bar code. Here is the code crashing on me below. I need this code so I can put a Next button in Nav Bar and the color. How do you coders do it? Any tips/suggestions? Thank you in advance. //setup navigation bar... LinearLayout navBar = BT_viewUtilities.getNavBarForScreen(this, this.screenData); if(navBar != null){ baseView.addView(navBar); LA
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/31/12 05:58 AM (11 years ago)
Hi @LA, it's probably just me, but I can't follow what you're asking. The nav bar settings are in the bt control panel. Is your app crashing? Do you have a logcat report for the crash?
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/31/12 07:52 AM (11 years ago)
Hey @raveyd, When I create a plugin from buzztouch, I download it and take all the code out and start coding from scratch. The plugin will still connect to menu then I start putting the original coding that came with it back in the plugin. You with me so far..lol? LA
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/31/12 08:17 AM (11 years ago)
Before I put that code in t works fine, after I put that code in it crashes. Logcat: 12-31 09:13:50.171: W/ZZ(349): BT_screen_menuListSimple:handleItemTap loads screen with itemId: "F1FA0C50BC78A086EC56EF7" 12-31 09:13:50.171: W/ZZ(349): BT_application:getScreenDataByItemId with itemId: = "F1FA0C50BC78A086EC56EF7" 12-31 09:13:50.211: W/ZZ(349): BT_application:getScreenDataByItemId with itemType: "Note_taker" with nickname: "Note Taker" 12-31 09:13:50.211: W/ZZ(349): BT_act_controller:loadScreenObject for screen with itemId: "F1FA0C50BC78A086EC56EF7" and itemNickname: "Note Taker" and itemType: "Note_taker" 12-31 09:13:50.373: W/ZZ(349): BT_screen_menuListSimple:onPause (BASE CLASS) 12-31 09:13:50.413: W/ZZ(349): BT_activity_base:onCreate (BASE CLASS) 12-31 09:13:50.609: D/dalvikvm(349): GC_EXTERNAL_ALLOC freed 4263 objects / 303448 bytes in 118ms 12-31 09:13:50.681: W/ZZ(349): BT_viewUtilities:updateBackgroundColorsForScreen with nickname: "Note Taker" 12-31 09:13:50.681: W/ZZ(349): BT_viewUtilities:getNavBarForScreen building nav. bar for screen with nickname: "Note Taker" 12-31 09:13:50.701: W/ZZ(349): BT_activity_base:backgroundWorkerThread this screen does not use a background image 12-31 09:13:50.720: D/AndroidRuntime(349): Shutting down VM 12-31 09:13:50.720: W/dalvikvm(349): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 12-31 09:13:50.740: E/AndroidRuntime(349): FATAL EXCEPTION: main 12-31 09:13:50.740: E/AndroidRuntime(349): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.voicenotes/com.voicenotes.Note_taker}: java.lang.NullPointerException 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.os.Handler.dispatchMessage(Handler.java:99) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.os.Looper.loop(Looper.java:123) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.ActivityThread.main(ActivityThread.java:4627) 12-31 09:13:50.740: E/AndroidRuntime(349): at java.lang.reflect.Method.invokeNative(Native Method) 12-31 09:13:50.740: E/AndroidRuntime(349): at java.lang.reflect.Method.invoke(Method.java:521) 12-31 09:13:50.740: E/AndroidRuntime(349): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 12-31 09:13:50.740: E/AndroidRuntime(349): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 12-31 09:13:50.740: E/AndroidRuntime(349): at dalvik.system.NativeStart.main(Native Method) 12-31 09:13:50.740: E/AndroidRuntime(349): Caused by: java.lang.NullPointerException 12-31 09:13:50.740: E/AndroidRuntime(349): at com.voicenotes.Note_taker.onCreate(Note_taker.java:99) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 12-31 09:13:50.740: E/AndroidRuntime(349): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 12-31 09:13:50.740: E/AndroidRuntime(349): ... 11 more 12-31 09:13:54.228: I/Process(349): Sending signal. PID: 349 SIG: 9
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/31/12 08:31 AM (11 years ago)
So if I look at this logcat, it tells me at java 99 there is a problem. That would be where I inserted the code for background. If I break this code down: //setup navigation bar... LinearLayout navBar = BT_viewUtilities.getNavBarForScreen(this, this.screenData); if(navBar != null){ baseView.addView(navBar); There is this "if (navBar != null) { null can throw an exception. Any ideas? LA
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/01/13 10:33 AM (11 years ago)
Solved!!!! LA
 

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.