Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6872179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:53:43+00:00 2026-05-27T03:53:43+00:00

I’m planning my first real android app and I want it to be a

  • 0

I’m planning my first real android app and I want it to be a universal app (tablet and phone). The layout will be three list views that are populated by the previous list view (list one always has same list of items, list two will be populated based on the list one selection, list three will be populated based on list one & two selections). Once an item in list three is selected, the details will show about the item. FYI, the data is in an XML file (containment hierarchy) and the details are the leaf nodes.

I plan to have two layouts. For the tablet, I’m going to have all three list view and the details on the same screen. For the phone, I’m going to have each list occupy the entire screen and when an item in selected, slide transition to the next list view (with nav at the top for going to the previous list as well as info on what the selection(s) were from the previous lists). When an item in the third list is selected, show the details page which will also have a button to start over (i.e. go back to the first list view).

I’ve got the tablet view working pretty well since that’s the simplest (just one screen, no transitions) – all in layout/main.xml. I’ve also got different layouts for different size screens (layout, layout-large, layout-small, layout-xlarge) all of which have the exact same main.xml at the moment.

So, finally to my question… How do I use the same code to populate the lists while having different user experience? I can see two options (please add more/better options)

  1. For the phone, should I continue to have one layout file (main.xml) and just have all three lists and the details on top of each other and via the slide transition, show/hide the widgets? (i.e. at first only the first list view is visible, the second list view is hidden, the third list view is hidden, the details are hidden)

  2. Should I have one layout xml for each of the screens on the phone (main.xml – initial list view, list2.xml, list3.xml, and details.xml)?

To determine if it’s a tablet or not, I plan to use the code from the Google I/O app
Developing an universal android application (phone and tablet)

EDIT (2011/11/29)
Found some good online resources regarding Fragments:
http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
http://portabledroid.wordpress.com/2011/06/22/25/
http://portabledroid.wordpress.com/2011/06/23/multi-platform-fragments-part-ii/
and the accompanying video:
http://www.youtube.com/watch?v=4BKlST82Dtg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:53:44+00:00Added an answer on May 27, 2026 at 3:53 am

    You want to read this document on supporting tablets and handsets, but the key to solving your problem is to use fragments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.