Beispiel #1
0
 @Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   Cursor cursor = movieAdapter.getCursor();
   cursor.moveToPosition(position);
   int columnMovieId = -1;
   if (currentType == FetchMoviesTask.TYPE_POP) {
     columnMovieId = cursor.getColumnIndex(MovieContract.PopMovieEntry.COLUNM_MOVIE_KEY);
   } else {
     columnMovieId = cursor.getColumnIndex(MovieContract.RateMovieEntry.COLUNM_MOVIE_KEY);
   }
   long movieId = cursor.getLong(columnMovieId);
   Intent intent = new Intent(getActivity(), DetailActivity.class);
   intent.putExtra(INTENT_MOVIE_ID, movieId);
   startActivity(intent);
 }
Beispiel #2
0
 @Override
 public void onLoaderReset(Loader<Cursor> loader) {
   movieAdapter.swapCursor(null);
 }
Beispiel #3
0
 @Override
 public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
   movieAdapter.swapCursor(data);
 }