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

  • Home
  • SEARCH
  • 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 8266481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:10:40+00:00 2026-06-08T05:10:40+00:00

This question is actually a 3 Part Question. Please suggest the valid solution for

  • 0

This question is actually a 3 Part Question. Please suggest the valid solution for my problem.

Application Overview

I’m creating an application having a splash screen and a ListView. On click of the launcher icon, first the splash screen is shown and then after 3-4 seconds later, the splash screen calls the ListView activity and user is left with ListView items on the phone screen. On click of each item, respective textual content will be visible to the user. After reading the content user will click the “Back” button and will be returned to hte ListView items section again. If he/she wants to read any other item content, will be taken to that page on the click of that item. If not willing, then will click “Back” button on phone and application will close.

Part 1 – What I actually want to do

I want to show different textual content (not normal text but styled (bold/italized/containing images and all) on the click of different listView items. I can create the html pages and store them in my resource folder locally but don’t know how to call those pages while calling onItemClickListener. I’m not sure if this is a valid approach to do this sort of work or not. Please advice. It’s not working so far

Part 2 – What I’m doing instead now

Since I was not able to call the textual content so I wrote the content on some text editor, did all the fancy work on the editor and when the content was ready, I took the screenshot and then call that image instead while calling onItemClickListener. It’s working fine and I’m able to see the image on click of my ListView item.

Part 3 – The problem I’m facing

When the image is shown to the user, on click of “Back” button, the application is closed instead of going back to the ListView Section. Apparently the image opening on click of the listview item is in the same activity as is the ListView itself. What I want is that user should be able to go back to the ListView section after he/she finishes reading the textual content.

Below is the code of the ListView Activity:
public class MainActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ListView listView = (ListView) findViewById(R.id.menulist);
    String[] values = new String[] { "1. First Article Here", "2. Second Article Here", "3. Third Article Here"};

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
        R.layout.custom_listview, R.id.text1, values);

    // Assign adapter to ListView
    listView.setAdapter(adapter);

    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, android.view.View view, int position, long id){
            //
            if(0==position)
            {
                setContentView(R.layout.image0); 

             }
            else if (1==position)
            {

            }
        }        

    });

}
*The code works fine upto setContentView(R.layout.image0);
*
But after this I want the application to return back to the ListView section on click of “Back” button but it closes instead. Please guide.

  • 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-08T05:10:42+00:00Added an answer on June 8, 2026 at 5:10 am

    May be it solves by,

    Using layout.image0 in another activity and call by intent when click on list item.

    By use this, When you click back button you view your previous activity

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

Sidebar

Related Questions

Note: all the quotation marks in this question are actually part of the code.
The first part of this question is actually a request for confirmation based on
This is actually a three-part question, which I'll explain below, but the questions are:
Problem This question actually came up at work today. We are planning an experiment
This question is more about guidance than actually solving my problem: I need to
This question actually has two parts. The first part: I've been developing my first
The Question actually says it all. The reason behind this question is I am
So, this is actually this question is my current keystone. I'm working on refactoring
I am finally asking this question as I have never actually found an answer.
There are actually 2 question i want to cover in this topic. 1) Is

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.