title: new Youtube api for android: getting video title
body: <p>I am using the new Youtube API for android. I have managed to use the API to display a particular playlist(using ListView) and upon clicking on a video on a list I am able to play that particular video.</p>
  
  <p>My question is this. How can I get the details for a particular video? Details such as video title and the number of views. I have tried looking in YoutubeThumbnailView/loader, YoutubePlayerView, YoutubePlayer but no luck.</p>
  
  <p>here is the code for the main activity let me know if you need further info.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <pre><code>public class MainActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener, YouTubeThumbnailView.OnInitializedListener{
  
  
  private final static String PLAY_LIST_ID = "XXX";
  private final static String DEV_KEY = "XXX";
  
  private YouTubeThumbnailView thumbnailView;
  private YouTubeThumbnailLoader loader;
  private ArrayList&lt;HashMap&lt;String, YouTubeVideo&gt;&gt; arrayList;
  private ListView listView;
  private SpecialAdapter adapter;
  private int counter;
  private YouTubePlayerView playerView;
  private YouTubePlayer player;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      String[] keys = new String[]{"key"};
      int[] values = new int[]{R.id.imageView1};  
      arrayList = new ArrayList&lt;HashMap&lt;String, YouTubeVideo&gt;&gt;();
      setContentView(R.layout.activity_main);
      listView = (ListView)findViewById(R.id.listView1);
      listView.setOnItemClickListener(new onListClickListener());
      playerView = (YouTubePlayerView)findViewById(R.id.player);
      thumbnailView = new YouTubeThumbnailView(this);
      thumbnailView.initialize(DEV_KEY, this);
      playerView.initialize(DEV_KEY, this);
      adapter = new SpecialAdapter(this, arrayList, R.layout.row_layout, keys, values);
  }
  
  
  class onListClickListener implements OnItemClickListener{
      @Override
      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
              long arg3) {
          playerView.setVisibility(View.VISIBLE);
          player.cueVideo(arrayList.get(arg2).get("key").videoID);
      }
  }
  
  @Override
  public void onInitializationSuccess(YouTubeThumbnailView arg0,
          YouTubeThumbnailLoader arg1) {
      loader = arg1;
      loader.setPlaylist(PLAY_LIST_ID);
      loader.setOnThumbnailLoadedListener(new OnThumbnailLoadedListener() {
          @Override
          public void onThumbnailLoaded(YouTubeThumbnailView arg0, String videoId) {
              HashMap&lt;String, YouTubeVideo&gt; map;
              ImageView imageView;
  
              if(loader.hasNext()){
                  map = new HashMap&lt;String, YouTubeVideo&gt;();
                  imageView = new ImageView(MainActivity.this);
                  imageView.setImageDrawable(arg0.getDrawable());
                  map.put("key", new YouTubeVideo(imageView, videoId));
                  arrayList.add(map);
                  loader.next();
              }else {
                  map = new HashMap&lt;String, YouTubeVideo&gt;();
                  imageView = new ImageView(MainActivity.this);
                  imageView.setImageDrawable(arg0.getDrawable());
                  map.put("key", new YouTubeVideo(imageView, videoId));
                  arrayList.add(map);
                  listView.setAdapter(adapter);
              }
          }
  
          @Override
          public void onThumbnailError(YouTubeThumbnailView arg0, ErrorReason arg1) {
          }
      });
  }
  
  @Override
  public void onInitializationFailure(YouTubeThumbnailView arg0,
          YouTubeInitializationResult arg1) {
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.activity_main, menu);
      return true;
  }
  
  @Override
  public void onInitializationFailure(Provider arg0,
          YouTubeInitializationResult arg1) {
  
  }
  
  @Override
  public void onInitializationSuccess(Provider provider, YouTubePlayer player,
            boolean wasRestored) {
      this.player = player;
  }
  
  @Override
    protected void onDestroy() {
      if(loader != null) {
          loader.release();
      }
      super.onDestroy();
    }
  </code></pre>
  
  <p>}</p>