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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:43:36+00:00 2026-06-18T01:43:36+00:00

I have two activities in my application. Activity1 has a list view and two

  • 0

I have two activities in my application. Activity1 has a list view and two buttons(say button1 and button2). Based on which button user clicks the content in the listview changes accordingly. The default loading of activity is having button1 click contents loaded in activity1.
In my Activity2, I have a button(say button3) which when clicked, has to load activity1 but with the listview loaded with button2 click results, not with the default display which shows the button1 click results.
Any help on how can I acheive this? On the onclick event of button3 in activity2 I can load activity1 but that will load with the default state showing button1 click results.

  • 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-18T01:43:38+00:00Added an answer on June 18, 2026 at 1:43 am

    Save the state of your ListView by passing a extra string with IntentHandler when switching between the activities:

    Intent intent = new Intent(getBaseContext(), yourActivity.class);
    intent.putExtra("LISTVIEW_STATE", myListViewState);
    startActivity(intent);
    

    Then in your recieving activities onCreate() method (in this case yourActivity) you can get the state with:

    Intent intent = getIntent();
    String recievedListViewState = intent.getStringExtra("LISTVIEW_STATE");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two activities in an android application, each has a button that goes
I have an application which has two Activities, let's call them A and B.
Say we have two activities, Activity1 and Activity2. In Activity1's onClick() method, we have
Say I have two Activities in an Android application, EditPerson and EditEmployee . It
I have an Android application that contains two Activities . Activity A has a
I have an Android Honeycomb application with two activities; the first one has a
I'm writing an application which will have two Activities, when the user presses the
I have an application it have two activities. When press a button in the
I have an application which consists of two activities/screens and a java class from
I have two Activities along with one Application class, and whenever I call my

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.