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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:12:52+00:00 2026-05-29T09:12:52+00:00

I just have a question regarding changing an Activities layout. Basicly my problem is:

  • 0

I just have a question regarding changing an Activities layout.

Basicly my problem is:

I have a list view populated with a series of Strings.
I have an OnItemClick event assigned to the ListView,

When the user clicks an item in the list view, I want the current layout to disapear and an image to take its place.

From reading other posts, I understand that the recommended way is to set a separate activity for each item in the ListView, however, seeming as all the activity is doing is displaying an image I think it would be a waste of effort to set up a separate activity for each item in the ListView…

Could anyone give me some help on this?

thanksin advance.

Shaw

  • 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-29T09:12:53+00:00Added an answer on May 29, 2026 at 9:12 am

    You really should create a new activity (ar a new fragment if you have space, but this is another question) which displays the image, for at least the following reasons

    1. it is very, very simple to code and mantain such a solution. What if tomorrow you want to add 2 buttons and some text and maybe a menu for that image? you have your brand new activity to edit and upgrade without risking to damage your list activity.

    2. it is more user friendly. If the user presses back when the image is shown, with 2 activities he will be back to the list, with your solution he will go back BEFORE the list, and this is not what he’d espect

    remember this piece of advice: 1 activity = 1 simple task or interaction with user.

    list + image display = 2 activities (or fragments)

    PS: you do not need to define a different activity for each list item, just pass with the intent to the “ImageActivity” and specify there which image to show!

    EDIT 2: to pass to the next activity your current selection, just use the putExtra(String key, T value) (T may vary, check documentation) method of Intent class.
    example: intent.putExtra(“imgCodeSelected”, index) where index is fetched by the onItemClick event. You can put as many extras as you want as long as they have different keys.

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

Sidebar

Related Questions

Just a small question regarding joins. I have a table with around 30 fields
I have just read a question regarding initializing multidimensional vectors ( question ) and
I just have a quick best practice question regarding custom cells in a UITableView.
I just have a simple question regarding dbms_stats.gather_table_stats. In our application this statement occurs
I'm just learning about generics and have a question regarding method return values. Say,
Hi there Im just learning JSF 2 using Primefaces. I have a question regarding
I just started using QT and I have a question regarding some basic stuff.
I am just new to <time.h> and have a question regarding to time_t and
Just finished reading Crockford's JavaScript: The Good Parts and I have a question concerning
I just have a quick question about how to get the length of a

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.