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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:15:00+00:00 2026-06-18T02:15:00+00:00

Now i am working with an android project here I’ve a list view that

  • 0

Now i am working with an android project here I’ve a list view that list view getting some results from the Google API by JSON class. Now i am trying to get some images through the TAG_ICON variable which returns a URL and i directly given the URL to the list adapter but while running my project i didn’t get any image in the image view layout please help me to fix this problem and here is my code

public class MyListActivity extends ListActivity {

    // JSON Node names
                private static final String TAG_CONTACTS = "results";
                private static final String TAG_ID = "id";
                private static final String TAG_NAME = "name";
                private static final String TAG_GENDER = "rating";
                private static final String TAG_REFERENCE = "reference";
                private static final String TAG_ICON = "icon";

    // contacts JSONArray
    JSONArray result = null;

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

        // url to make request

        Intent in = getIntent();
         String location = in.getStringExtra("TAG_LOCATION");
         String type = in.getStringExtra("TAG_TYPE");
        url = "https://maps.googleapis.com/maps/api/place/textsearch/json?query="+type+"+in+"+location+"&sensor=true&key=AIzaSyD38pak_katUfSR92WE2_O2b9y0JSp5htA";
        //}

    new LoadData().execute();

    }

class LoadData extends AsyncTask<String, String, String>
    { 

    // Hashmap for ListView
        ArrayList<HashMap<String, String>> contactList = new ArrayList<HashMap<String, String>>();
    protected String doInBackground(String... args) {


        // Creating JSON Parser instance
        JSONParser jParser = new JSONParser();
        // getting JSON string from URL

        JSONObject json = jParser.getJSONFromUrl(url);
        RatingBar myratingbar = (RatingBar)findViewById(R.id.ratingbar);

        try {
            // Getting Array of Contacts
            result = json.getJSONArray(TAG_CONTACTS);
            // looping through All Contacts
            for(int i = 0; i < result.length(); i++){
                JSONObject c = result.getJSONObject(i);

                // Storing each json item in variable
                String id = c.getString(TAG_ID);
                String name = c.getString(TAG_NAME);
                String icon = c.getString(TAG_ICON);

            // creating new HashMap
                HashMap<String, String> map = new HashMap<String, String>();

                // adding each child node to HashMap key => value
                map.put(TAG_ID, id);
                map.put(TAG_NAME, name);
                map.put(TAG_ICON, icon);

                // adding HashList to ArrayList
                contactList.add(map);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
            }    
        protected void onPostExecute(String file_url) {

        /**
         * Updating parsed JSON data into ListView
         * */
        ListAdapter adapter = new SimpleAdapter(MyListActivity.this, contactList,
                R.layout.listview_item_row,
                new String[] {TAG_ICON,TAG_NAME}, new int[] {
                        R.id.imgIcon,R.id.txtTitle});

        setListAdapter(adapter);

        // selecting single ListView item
        ListView lv = getListView();

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


            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {

                // Starting new intent
                Intent in = new Intent(getApplicationContext(), ProfileViewActivity.class);
                startActivity(in);

            }
        });

        }

}
}
  • 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-18T02:15:02+00:00Added an answer on June 18, 2026 at 2:15 am

    Use a custom webview element and set url in your java file.

    WebView webview = (WebView)findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.loadUrl(getString(R.URL.myurl));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Google Maps API in an Android project and now I
I am working with a Google map oriented android project now i got a
I'm having an Android GPS project for my CS class. Right now I'm working
I'm working through some android tutorials right now in preparation for a two week
I have added Jacson libs to my android project and now I am getting
I have an Android project using Google Calendar v3 API. I'm using Google API
I am working with an android project. Now i am creating a customized overlay
I'm currently working on debugging some code with my android project. I'm having an
I have dug out an old android project that I was working on a
I am working on an Android project and I am now working on the

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.