Exemplo n.º 1
0
 /** reloadStores and clean Contextual Action Bar if present */
 public void reloadStores() {
   Log.v("SOURCES", "reloading sources");
   Loader l = getSherlockActivity().getSupportLoaderManager().getLoader(LOADER_INDEX);
   if (l != null) {
     adapter.clear();
     l.forceLoad();
   }
   if (actionMode != null) {
     actionMode.finish();
     selected = new ArrayList<LayerStore>();
     getListView().clearChoices();
     getListView().clearFocus();
   }
 }
Exemplo n.º 2
0
  /* (non-Javadoc)
   * @see android.support.v4.app.LoaderManager.LoaderCallbacks#onLoadFinished(android.support.v4.content.Loader, java.lang.Object)
   */
  @Override
  public void onLoadFinished(Loader<List<LayerStore>> loader, List<LayerStore> result) {

    adapter.clear();
    ArrayList<LayerStore> ll = new ArrayList<LayerStore>();
    int size = result.size();

    Log.v("SOURCES", "Loaded sources:" + size);
    if (size > 0) {
      for (LayerStore ls : result) {
        adapter.add(ls);
      }
    }

    adapter.notifyDataSetChanged();
  }
Exemplo n.º 3
0
 /* (non-Javadoc)
  * @see android.support.v4.app.LoaderManager.LoaderCallbacks#onLoaderReset(android.support.v4.content.Loader)
  */
 @Override
 public void onLoaderReset(Loader<List<LayerStore>> arg0) {
   adapter.clear();
 }