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 8358325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:45:35+00:00 2026-06-09T10:45:35+00:00

I am a newbie to android programming I have two listviews in my activity

  • 0

I am a newbie to android programming

I have two listviews in my activity and two buttons. If I press first button one listview will be created and shown in the activity and when the second button is clicked the second listview is created and first one should be closed.

Can anyone suggest me how to do this??

Thanks in advance..

  • 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-06-09T10:45:37+00:00Added an answer on June 9, 2026 at 10:45 am

    You should consider using fragments. Use a frame layout in your main activity. Then depending on the user choice load one of the fragment dynamically.

    case (R.id.button1):
    FragmentTransaction fragmentTransaction = fragmentManager
                        .beginTransaction();
    fragmentTransaction.replace(R.id.fragment, frag1);
    fragmentTransaction.commit();
    break;
    

    See http://developer.android.com/guide/components/fragments.html && http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html

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

Sidebar

Related Questions

I am a newbie to Android programming. I want two radio buttons that when
Hi am newbie to android development. I had created one application where i need
I am a complete Android programming newbie. I have completed some tutorial examples like
This might sound stupid, but I'm seriously a newbie at Android programming. I have
I'm a android newbie. Recently I created a activity which has a HorizontalScrollView at
Hi I'm a newbie in Android Programming. I'm trying to build an activity which
i am newbie for Android Development. i don't have any idea for creating Scientific
I am newbie in android, in my android app, a main Activity class, which
I have the following thing to achieve in Android(newbie). I have an xml which
I am newbie to android. I have client server based application. Server keeps on

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.