Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 77

Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
07/02/13 05:49 PM (12 years ago)

Android Initial loading page

Greeting, I have 5 tab menus use on my android app. Home page- custom URL screen, menu button screen, menu list screen, and the other two is also custom URL screens. My idea is to load the home page which is the custom URL screen as my initial loading page. But buzztouch always loads the menu list screen as first attempt. If I removed the menu list screen from the tab menu, it then loads the menu button screen. How can I set this right? Appreciated for any input. Platform: Self host
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/03/13 05:05 AM (12 years ago)
So, the '3rd' screen is the screen that appears when the app starts? Cheers! -- Smug (I haven't experimented with Android yet, but I 'think' you can set (or find out) selected tabs using: setSelectedTab(int); int = getSelectedTab; these are found in your BT_application.java file. The 'theory' is that the first screen is the home screen.
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
07/03/13 05:40 AM (12 years ago)
@ SmugWimp, actually my home screen became the "last" screen when the app starts. That's good direction to start with.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/03/13 05:45 AM (12 years ago)
I'm not sure if it matters, but if you look at your raw JSON config under the 'tabs' it should reflect the load order (and again, in theory that is tab 1~5 ascending). It may or may not contribute to understanding what's going on here... it does sound a bit odd. Cheers! -- Smug
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
07/03/13 05:58 AM (12 years ago)
@ Smug, You're exactly right, in theory that's what I thought. In "Tabbed Layout", I named home and set to first tab menu to load. In theory it shouldn't be any issues. This is exactly what I did for iOS app. But when I tested on device or even on emulator. The initial loading page always be menu button or menu list screen. Very weird.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/03/13 06:24 AM (12 years ago)
Is the tab order in the JSON file the way you've set it up in the Control Panel? I wonder if it 'has' to be a menu, although I've not seen anything in the documentation, nor have I noticed anything that filters the code. Of course I haven't been looking for *that* yet, so I can't be sure... Cheers! -- Smug Edit: Snooping around a bit more, I see nothing in the code (BT_activity.java - line 256) that filters the tabs by type or anything... quite puzzling.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/03/13 09:37 AM (12 years ago)
Have a look at BT_activity_root_tabs.java in the existing Android project. This handles the layout for each tab. Scroll down (or search for) tabHost.setCurrentTab(0);, it's on about line 300. Change the zero to the selected tab you want to show as the default and I'll bet it does exactly what you want. Grinding away on Android 4.0 Action Bar support for newest Android project. Looking forward to NOT having the tabHost tabSpec stuff you see in your download now. That approach has been deprecated and everything is moving towards the Action Bar :-)
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
07/03/13 05:07 PM (12 years ago)
@David, YOU'RE A LIFE SAVER, THANK YOU SO MUCH!!! @ Smug, really appreciated your time, THANK YOU!!!
 
Warren Evans
Apple Fan
Profile
Posts: 277
Reg: Jan 28, 2012
Effingham IL
17,400
like
07/03/13 09:59 PM (12 years ago)
@Cyrus_8888 - Here's a short video from David responding to your post (follow this forum link): https://www.buzztouch.com/forum/thread.php?fid=E9B0A123DB40BA3F9E23EFB&tid=E9B0A123DB40BA3F9E23EFB
 

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.