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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:53:14+00:00 2026-05-28T00:53:14+00:00

I have JSON data which contents Strings and Image URLs, and I already parse

  • 0

I have JSON data which contents Strings and Image URLs, and I already parse it in the first Activity. How can I display it like the address book in my customized Listview in second Activity Should I customize an Adapter?

If that’s the solution, what should I do?

I’m not familiar with Adapter.

Here’s the code from the first Activity:

public class BBtest05Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try {
        executeHttpGet();
    } catch (Exception e) {
        Log.i("bird","parser failure");
        e.printStackTrace();
    }
    }

    String aStr = new String();
    String aStrArray[] = new String[2048];
    public void executeHttpGet() throws Exception {
        try {
        HttpClient client = new DefaultHttpClient();
        HttpGet request = new HttpGet("http://test.mobibon.com.tw/MovieGoTest/GetMovies.js");
        HttpResponse response = client.execute(request); 
         String retSrc = EntityUtils.toString(response.getEntity(),"utf-8");
        //there's a space in the head...
         retSrc = retSrc.substring(1);
           JSONObject obj = new JSONObject(retSrc);
           JSONArray movieArray = obj.getJSONArray("movies");
           for(int i = 0;i < movieArray.length(); i++)
           {
           JSONObject movie_data = movieArray.getJSONObject(i);
           aStr = aStr+","+movie_data.getString("cTitle");

           }
           } finally {
               aStrArray = aStr.split(",");
               ListView list = (ListView) findViewById(R.id.linearLayout1);
               list.setAdapter(new ArrayAdapter<String>(this,
               android.R.layout.simple_list_item_1, aStrArray));
               list.setTextFilterEnabled(true);
           }
}
public void aMethod(View theButton) {   
    Intent i = new Intent(this,nowamovie.class);    
    startActivity(i);
}

}

the aMethod is changing Activity method…

and the following code is my XML file in second Activity…

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent" 
android:layout_width="fill_parent" 
android:orientation="vertical" android:background="@drawable/pic_background">
<LinearLayout android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:id="@+id/linearLayout1" >
<ImageView android:layout_height="wrap_content"
android:id="@+id/imageView1" 
android:layout_width="wrap_content" 
android:src="@drawable/ic_launcher"></ImageView>
<TextView android:text="TextView" 
android:id="@+id/textView1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_marginLeft="6dip"
android:layout_marginTop="6dip" 
android:textAppearance="?android:attr/textAppearanceLarge">
</TextView>
</LinearLayout>
<LinearLayout android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:id="@+id/linearLayout1" 
android:orientation="horizontal">
<TextView android:id="@+id/textView2" 
android:text="TextView" 
android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:textAppearance="?android:attr/textAppearanceSmall">
</TextView>
<TextView android:text="TextView" android:id="@+id/textView3" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:textAppearance="?android:attr/textAppearanceSmall" 
android:layout_marginLeft="6dip">
</TextView>
</LinearLayout>

What should I do to put my data from JSON parser into this Activity?

  • 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-28T00:53:14+00:00Added an answer on May 28, 2026 at 12:53 am

    Yes you need to customize your adapter and loading of images should be lazy, search on google for Lazy Implementation of images in list, and you would get enough material on this. In 3.0 there is a new feature introduced which is Loader, which do this lazy loading work for you.

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

Sidebar

Related Questions

I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I have an application which obtains data in JSON format from one of our
I have a method to which I want to post some json data, that
I use json data with jquery... I have filepaths in json and i am
I have a problem accessing JSON data. I'm new to JSON and jquery so
I have a controller that is called with AJAX (sends JSON data), so I
I have a website where an ajax call will get some Json data from
I have to serialize & desserialize json data. if the data type was XSD,
I have an issue regarding to auto populating a select dropdown from jQuery/JSON data
I have a set of data in one JSON structure: [[task1, 10, 99], [task2,

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.