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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:06:07+00:00 2026-06-17T19:06:07+00:00

I have a single activity that displays different fragments instead of changing activities. In

  • 0

I have a single activity that displays different fragments instead of changing activities. In one fragment, I have a ListView where each item has a couple ImageViews and TextViews. When the user clicks on an ListView item, the activity switches fragments, but the new fragment will share all of the same Views as the ListView item, plus some more stuff added in that specific fragment.

Is there a way to pass views between fragments so I don’t have to inflate all the same views again? Would it be better to get the bitmaps and text strings from the Views in the list item and populate those into new Views in the new fragment?

  • 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-17T19:06:08+00:00Added an answer on June 17, 2026 at 7:06 pm

    Short answer to your question.
    No there is not a way to share views between fragments unless both fragments will have the same layout.
    A view is only a container that describes a layout in your application. It is up to you to manipulate data to fill the containers.

    I do not think that you are trying to use the same view. I think that what you want is the data that was in the view in the list. You are going to have to deal with fragment to fragment communication. This involves setting up an interface and passing the data to your main activity and having your other fragment get that data from the activity when it is created. I put a link to a post i responded to. The code i posted uses fragments to display the applicaiton instead of activities. I left out a few fragments but the code for interfaces is there as well as some good links. If you have any questions about it let me know.

    Fragment Demo Code

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

Sidebar

Related Questions

I have an single Activity application that starts a Service and binds to it.
I have a single-threaded application that uses 3 SQLite databases in 3 different files
I will have an activity feed per user that displays all activity related to
I'm trying to have an Activity that shows just a few (or one) preference
I have a single Activity application with a data container that is populated at
in my android project I have one single activity named NewsViewActivity.java. But when I
I have created a custom listview that is populated using a row.xml file. Each
I have a custom listview row that contains a number of textView components. Instead
I have an activity with a single TextView (tv1) and a button that, when
I have an Activity that has a single ImageView on it, but it swaps

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.