Example #1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   mCurrentCategory = Category.NEW;
   mCategories = new String[Category.values().length];
   Category[] categories = Category.values();
   for (int i = 0; i < categories.length; ++i) {
     mCategories[i] = categories[i].getDisplayName();
   }
   mSpinnerAdapter =
       new ArrayAdapter<String>(
           getActivity(), android.R.layout.simple_spinner_dropdown_item, mCategories);
 }
Example #2
0
 @Override
 public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
   mCurrentCategory = Category.values()[position];
   if (position != mCurrentSpinnerPosition) {
     mCurrentSpinnerPosition = position;
     mGridAdapter.clear();
     mPage = 0;
     mEndCategory = false;
   }
   new LoadDataTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
 }