You keep complaining about ungrateful users that give your app a low ratings. It's not their fault, you brought this upon yourself. I've looked at your app and collected a list of what you did to make it so...Read More
Using a tabbar, either at the top or bottom of an interface, is a typical design pattern used in apps to navigate between segments. This is used by the Android Twitter client for example. The typical way to implement this is by using TabWidget, TabActivity, TabHost and friends. Each tab is populated with whatever activity you want and all is well. There is a problem with this approach however. If you start a new activity the tabs (area A, B, C) all disappear and this is not always what you want. Sometimes what you want is to keep the tabbar around and have an individual backstack for each of the tabs.
I've published an example on github that shows how you can get the best of both worlds. It explains how to keep an individual backstack for each tab, but also how to start activities that break out of the tabs as is the traditional way on Android. The Back button still works and you can also programmatically navigate back. The behavior of back is changed to respect the backstack of each individual tab.
If you want to try it out yourself I've compiled an Android package for you. Navigate to http://bit.ly/stacksintabs with your Android device and install the .apk to check it out.
The design is very simple. I still use TabWidget, TabHost and TabActivity (layout here) - but instead using normal activities for each tab, I subclass FragmentActivity - and build a stack of Fragments inside each tab. The gist of the code is in the addFragment(...) function
To launch a new fragment inside a tab (area D), see the launchNewFragment() function, and to see how you break out of the tabs and launch a new activity (area E) see the function launchNewActivity(...)
My initial approach at solving this problem was using Fragments exclusively, but since nested Fragments are not supported on Android I gave up.
I hope this helps some of you - it's all available under a BSD license. The example requires API level 7 and uses the Android Support library v4. Comments and contributions are welcome. Btw: I'm also working on a comparison between QML and Android XML where I compare pros and cons, so stay tuned for more :)
We're back from Qt Developer Days 2011 in Munich, Germany. What a great show! For those of you who werent' there here is a small recap of what happened from our perspective. First, some pictures [slideshow]
Both Marius and I were presenting in Munich. Marius dissected the code of several of our apps, and explained how QStateMachine makes your life easier. The talk is available here:
<iframe src="http://www.slideshare.net/slideshow/embed_code/9887016" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="https://www.slideshare.net/mariusbu/the-anatomy-of-real-world-apps" title="The Anatomy of Real World Apps - Dissecting cross-platform apps written using Qt Quick and C++" target="_blank">The Anatomy of Real World Apps - Dissecting cross-platform apps written using Qt Quick and C++</a> </strong> from <strong><a href="http://www.slideshare.net/mariusbu" target="_blank">Marius Bugge Monsen</a></strong> </div>
I talked about Necessitas, Qt and Qt for Android and basically explained how you publish Qt apps on the Android market. That talk is available here:
<iframe src="http://www.slideshare.net/slideshow/embed_code/9887763" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="https://www.slideshare.net/snowpong/targeting-android-with-qt" title="Targeting Android with Qt" target="_blank">Targeting Android with Qt</a> </strong> from <strong><a href="http://www.slideshare.net/snowpong" target="_blank">Espen Riskedal</a></strong> </div>
Now we gotta work to catch up on other projects!