protected void onPostExecute(Integer count) { mDialog.dismiss(); // finish keep screen on while downloading mContext.getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); if (count > 0) { mAdapter.clear(); ArrayList<MapModel> maps = mDataSource.getAllMaps(); Iterator<MapModel> iterator = maps.iterator(); while (iterator.hasNext()) { MapModel map = iterator.next(); mAdapter.add(map); } mAdapter.notifyDataSetChanged(); } else { Toast.makeText(mContext, R.string.updateFailed, Toast.LENGTH_LONG).show(); } }
/** * This method will take a MutableMap and wrap it directly in a UnmodifiableMutableMap. It will * take any other non-GS-map and first adapt it will a MapAdapter, and then return a * UnmodifiableMutableMap that wraps the adapter. */ public static <K, V, M extends Map<K, V>> UnmodifiableMutableMap<K, V> of(M map) { if (map == null) { throw new IllegalArgumentException("cannot create a UnmodifiableMutableMap for null"); } return new UnmodifiableMutableMap<K, V>(MapAdapter.adapt(map)); }