1. Are you ready for the Galaxy S20? Here is everything we know so far!

TabView - Quick explanation and resources

Discussion in 'Android Development' started by Deleted User, Aug 2, 2010.

  1. Deleted User

    Deleted User Guest
    Thread Starter

    Hi,

    I've been developing my first app for a couple of weeks now. I have 5 screens and everything seems well. However, I'm considering changing the app's navigation to a TabView.

    I haven't delved much into it, but I'm hoping someone can save me a little bit of time. It seems that people don't generally place Activities inside each tab. They simply point the tab content to a View. This is where my major setbacks are. 1) I already have Activity classes full of code and 2) I can't quickly guess how the structure of an app using TabView looks. For example, where do I put the handler code for clicking a button on a View? Does it all just get dumped into the TabView Activity somehow?

    Could you please give me a quick synopsis of what I'm looking at doing, answers to any questions you think I may have, and point me toward some resources for creating TabView applications? A quick Google search really just shows me how to create a TabView Activity and add a couple tabs to it. The code doesn't go any deeper.

    Thanks for your help
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Deleted User

    Deleted User Guest
    Thread Starter

    At the moment I have Activities populating the content of my tabs. I've noticed something rather annoying. My MAIN Activity is an Activity I wrote for my user to log in to their account. After logging in, they are taken to my Tab Activity. Here is what happens:

    When I am on my Tab Activity and I "minimize" the app by clicking the Home button and then launch it again, I don't get taken back to the Tab Activity. I get taken to my log in Activity. Why? I don't have the launchMode of my Tab Activity set to singleInstance... or is it singleInstance by default? How can I make the app re-launch showing the Tab Activity?
     
  3. cp1

    cp1 Android Enthusiast

    It seems like you'll have to save which activity you're in and reload that?

    I just checked my app, and if I go to home and back to the app when I'm in the tab activity it force closes! I'll have to figure that out, thanks for making me check it.
     
  4. Deleted User

    Deleted User Guest
    Thread Starter

    I found my problem. My login Activity has noHistory set to true. I'm not quite sure why this causes the behavior I was seeing, but getting rid of it solves the problem.
     
  5. cp1

    cp1 Android Enthusiast

    Glad you found it -- and I'm glad you brought this up. I found a bad database / cursor error because of it!
     
Loading...
Similar Threads - TabView Quick explanation
  1. EvoVAlpha
    Replies:
    1
    Views:
    373
  2. groston
    Replies:
    6
    Views:
    1,419
  3. emiegna
    Replies:
    0
    Views:
    773
  4. Ecoermobile123
    Replies:
    0
    Views:
    766
  5. smallclone
    Replies:
    4
    Views:
    1,192
  6. andryuhaagressor
    Replies:
    6
    Views:
    851
  7. ysy950803
    Replies:
    1
    Views:
    1,482
  8. sand1
    Replies:
    4
    Views:
    4,201
  9. July Hoang
    Replies:
    15
    Views:
    2,434
  10. elantrauma
    Replies:
    4
    Views:
    3,399

Share This Page

Loading...