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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:35:33+00:00 2026-06-17T18:35:33+00:00

I am using Listview to display image and data using json parser, But when

  • 0

I am using Listview to display image and data using json parser,

But when i click on one of the list item image is not displaying in next activity i.e in detailed Activity.

I am using the following code to display image. Can any one guide me in right path? Any help wud be appreciated.

// Launching new screen on Selecting Single ListItem
    list.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            // getting values from selected ListItem
            String title = ((TextView) view.findViewById(R.id.title)).getText().toString();
            String date = ((TextView) view.findViewById(R.id.date)).getText().toString();
            String name = ((TextView) view.findViewById(R.id.name)).getText().toString();
            String content = ((TextView) view.findViewById(R.id.content)).getText().toString();
             // getting JSON string from URL
            JSONObject json = jParser.getJSONFromUrl(URL);
             try {
                 posts = json.getJSONArray(KEY_POSTS);

    // looping through all song nodes <song>
            for(int i = 0; i < posts.length(); i++){
                JSONObject c = posts.getJSONObject(i);
                // Storing each json item in variable

                String url = null;
                String slug = null;
                try {
                JSONArray atta = c.getJSONArray("attachments");
                for(int j = 0; j < atta.length(); j++){
                    JSONObject d = atta.getJSONObject(j);

                    slug = d.getString(KEY_SLUG);

                    JSONObject images = d.getJSONObject(KEY_IMAGES);

                    JSONObject thumbnail = images.getJSONObject(KEY_THUMB_URL);
                    url = thumbnail.getString(KEY_URL);

                }
                } catch (Exception e) {
                    e.printStackTrace();

                }



            // Starting new intent
            Intent in = new Intent(getApplicationContext(),SampleDesp.class);
            in.putExtra(KEY_TITLE, title);
            in.putExtra(KEY_DATE, date);
            in.putExtra(KEY_NAME, name);
            in.putExtra(KEY_CONTENT, content);
            in.putExtra(KEY_URL, url);      
            startActivity(in);

        }


             }catch (JSONException e) {
                    e.printStackTrace();

                    }
        }

    });   

}

}

And in Singlemenuitem.java

 // getting intent data
        Intent in = getIntent();
        final String url1 = in.getStringExtra(KEY_URL);

        ImageView imgv = (ImageView) findViewById(R.id.imgdesc);
        ImageLoader imageLoader = new ImageLoader(getApplicationContext());
        imageLoader.DisplayImage(url1, imgv);





        // Get JSON values from previous intent
        final String title = in.getStringExtra(TAG_TITLE);
        String date = in.getStringExtra(TAG_DATE);
        String name = in.getStringExtra(TAG_NAME);
        final String content = in.getStringExtra(TAG_CONTENT);

        // Displaying all values on the screen
        TextView lblName = (TextView) findViewById(R.id.name_label);
        TextView lblCost = (TextView) findViewById(R.id.email_label);
        TextView lblDesc = (TextView) findViewById(R.id.mobile_label);
        TextView lblCont = (TextView) findViewById(R.id.content_label);

        lblName.setText(title);
        lblCost.setText(date);
        lblDesc.setText(name);
        lblCont.setText(content);
  • 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-17T18:35:34+00:00Added an answer on June 17, 2026 at 6:35 pm

    Thank you All for your help and support, Just Add the below code in MainActivity class

        // Launching new screen on Selecting Single ListItem
        list.setOnItemClickListener(new OnItemClickListener() {
    
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
                HashMap<String, String> map = songsList.get(position);
    
                Intent in = new Intent(MainActivity.this, SampleDesp.class);
                in.putExtra(KEY_TITLE, map.get(KEY_TITLE));
                in.putExtra(KEY_DATE, map.get(KEY_DATE));                         
                in.putExtra(KEY_NAME, map.get(KEY_NAME));
                in.putExtra(KEY_CONTENT, map.get(KEY_CONTENT));
                in.putExtra(KEY_URL, map.get(KEY_URL));
    
                startActivity(in);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using listview to display data, inside listview i am using image in
I am using listview to display data, inside listview i am using image in
I am using a ListView to load and display thumbnails for image files. The
I am using a listview to display a list of all the users of
I have a Image list assigned to a listview to display transparent images. There
I am using listview to display three textviews(values for these text views where come
I have a ListView which is using a GridView to display a DataTable and
In my phonegap app I display a 240x240 image in a listview where it
I have a listview which I want to display custom data like zodiac Sign
I have a ListView than contains a list of image created from web link

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.