Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get youtube thumbnails in a listview using JSON in Android? My code so far:
    primarykey
    data
    text
    <p>Trying yo get info on how to use all the tags in the url mentioned in the code below.</p> <p>public class YoutubeVideoMain extends Activity {</p> <pre><code>ListView videolist; ArrayList&lt;String&gt; videoArrayList = new ArrayList&lt;String&gt;(); ArrayAdapter&lt;String&gt; videoadapter; Context context; String feedURL = "https://gdata.youtube.com/feeds/api/users/twistedequations/uploads?v=2&amp;alt=jsonc&amp;start-index=1&amp;max-results=5"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = this; setContentView(R.layout.youtubelist); videolist = (ListView) findViewById(R.id.videolist); videoadapter = new ArrayAdapter&lt;String&gt;(this, R.layout.video_list_item, videoArrayList); videolist.setAdapter(videoadapter); VideoListTask loadertask = new VideoListTask(); loadertask.execute(); } private class VideoListTask extends AsyncTask&lt;Void, String, Void&gt; { ProgressDialog dialogue; @Override protected void onPostExecute(Void result) { super.onPostExecute(result); dialogue.dismiss(); videoadapter.notifyDataSetChanged(); } @Override protected void onPreExecute() { dialogue = new ProgressDialog(context); dialogue.setTitle("Loading items.."); dialogue.show(); super.onPreExecute(); } @Override protected Void doInBackground(Void... params) { HttpClient client = new DefaultHttpClient(); HttpGet getRequest = new HttpGet(feedURL); try { HttpResponse response = client.execute(getRequest); StatusLine statusline = response.getStatusLine(); int statuscode = statusline.getStatusCode(); if (statuscode != 200) { return null; } InputStream jsonStream = response.getEntity().getContent(); BufferedReader reader = new BufferedReader( new InputStreamReader(jsonStream)); StringBuilder builder = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { builder.append(line); } String jsonData = builder.toString(); JSONObject json = new JSONObject(jsonData); JSONObject data = json.getJSONObject("data"); JSONArray items = data.getJSONArray("items"); for (int i = 0; i &lt; items.length(); i++) { JSONObject video = items.getJSONObject(i); videoArrayList.add(video.getString("title")); } Log.i("YouJsonData:", jsonData); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } return null; } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } </code></pre> <p>}</p> <p>I am trying to get thumbnails in the listview and also trying to open a new video player on click of any item. The above code is displaying list of items with a title of the video but I also want to add thumbnails to it. </p> <p>Help me out with this problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload