@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.line_list);

    // Setup the list
    adapter = new IconAdapter<FileWrapper>(this, R.layout.line_list_item);
    ListView list = (ListView) findViewById(R.id.list);
    list.setAdapter(adapter);
    list.setOnItemClickListener(this);

    // Load Directory
    if (savedInstanceState != null) {
      backStack = savedInstanceState.getParcelableArrayList("BACKSTACK");
    }

    if (backStack == null || backStack.size() == 0) {
      backStack = new ArrayList<BackStackItem>();
      String startPath =
          (startDirectory == null || startDirectory.isEmpty())
              ? Environment.getExternalStorageDirectory().getPath()
              : startDirectory;
      backStack.add(new BackStackItem(startPath, false));
    }

    wrapFiles();
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
  }
  @Override
  public void restoreState(Parcelable state, ClassLoader loader) {
    if (state != null) {
      Bundle bundle = (Bundle) state;
      bundle.setClassLoader(loader);
      ArrayList<FragmentState> fs = bundle.getParcelableArrayList("states_fragment");
      ArrayList<Bundle> args = bundle.getParcelableArrayList("arg_fragment");
      ArrayList<String> tags = bundle.getStringArrayList("tag_fragment");
      ArrayList<String> classNames = bundle.getStringArrayList("classname_fragment");

      mFragments.clear();
      mFragmentStates.clear();
      mFragmentTags.clear();
      mFragmentClassNames.clear();
      mFragmentArgs.clear();
      if (fs != null) {
        for (int i = 0; i < fs.size(); i++) {
          FragmentState fragmentState = fs.get(i);
          mFragmentStates.add(fragmentState);
          if (fragmentState != null) {
            mFragmentArgs.add(fragmentState.mArguments);
            mFragmentTags.add(fragmentState.mTag);
            mFragmentClassNames.add(fragmentState.mClassName);
          } else {
            mFragmentArgs.add(args.get(i));
            mFragmentTags.add(tags.get(i));
            mFragmentClassNames.add(classNames.get(i));
          }
          mFragments.add(null);
        }
      }
      Iterable<String> keys = bundle.keySet();
      for (String key : keys) {
        if (key.startsWith("f")) {
          int index = Integer.parseInt(key.substring(1));
          Fragment f = null;
          try {
            f = mFragmentManager.getFragment(bundle, key);
          } catch (Throwable ex) {
            ex.printStackTrace();
          }
          if (f != null) {
            f.setMenuVisibility(false);
            mFragments.set(index, f);
            mFragmentArgs.set(index, f.mArguments);
            mFragmentTags.set(index, f.mTag);
            mFragmentClassNames.set(index, f.getClass().getName());
          } else {
            Log.w(TAG, "Bad fragment at key " + key);
          }
        }
      }
      // If restore will change
      notifyDataSetChanged();
    }
  }
 @Override
 protected void onRestoreInstanceState(Bundle savedInstanceState) {
   super.onRestoreInstanceState(savedInstanceState);
   DataToSaveImagesVehicles data = savedInstanceState.getParcelable("map");
   imagesMap = data.getMap();
   imageVehicles = savedInstanceState.getParcelableArrayList("arrayList");
   orientation = savedInstanceState.getInt("orientation");
   vehicleOptions = savedInstanceState.getParcelableArrayList("options");
   currentVehicle = savedInstanceState.getParcelable("currentVehicle");
 }
  /**
   * onCreate method is created
   *
   * @param savedInstanceState
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.offlocationmenu);

    findViewById(R.id.button_virtual_tour).setOnClickListener(this);
    findViewById(R.id.button_division_list2).setOnClickListener(this);
    findViewById(R.id.button_apply2).setOnClickListener(this);

    Bundle extras = getIntent().getExtras();
    mListOfDivisions = extras.getParcelableArrayList("com.example.tourapp.divisionArrayList");
    mListOfPlaces = extras.getParcelableArrayList("com.example.tourapp.placeArrayList");
  } // end method onCreate
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (savedInstanceState != null) {
      ArrayList<MovieItem> checkItems =
          savedInstanceState.getParcelableArrayList(STATE_CAB_CHECKED_ITEMS);
      mCheckedItems.addAll(checkItems);
      ArrayList<MovieItem> list = savedInstanceState.getParcelableArrayList(STATE_LIST);
      setListAdapter(new MovieArrayAdapter(getActivity(), list));
    } else {
      setListAdapter(new MovieArrayAdapter(getActivity()));
    }
  }
Exemple #6
0
 public void onCreate(Bundle paramBundle) {
   super.onCreate(paramBundle);
   if (paramBundle != null) {
     this.mSaleList = paramBundle.getParcelableArrayList("onsaleObjs");
     this.mbReqFinished = paramBundle.getBoolean("isRequestFinished");
   }
 }
Exemple #7
0
    @Override
    public void handleMessage(Message msg) {
      ImageActivity activity = mActivity.get();
      if (activity != null) {
        if (msg.what == COMPLETED) {
          Bundle bundle = msg.getData();
          activity.filterWord = bundle.getParcelableArrayList(WORD_KEY);
          activity.setBtnEnable(true);
        } else if (msg.what == ADD_SHARE) {
          Uri uri = msg.getData().getParcelable(URI_KEY);
          Log.d(TAG, "uri " + uri);
          activity.mShareActionProvider.setShareIntent(activity.getDefaultIntent(uri));
        } else if (msg.what == FILTER_OK) {
          // ArrayList<String> filterString = new ArrayList<String>();
          ArrayList<Integer> list = msg.getData().getIntegerArrayList(FILTER_KEY);
          if (list.size() == 0) {

            activity.mUserFilter = null;
          } else {
            for (int i : list) {
              String s = activity.filterWord.get(i).str;
              Log.d(TAG, "onFilterClick  " + s);
              // filterString.add(s);
              activity.mUserFilter.add(s);
            }
            /*ImageFragment fragment = (ImageFragment) getFragmentManager().
                    findFragmentById(R.id.image_fragment);
            fragment.newImage(mUserFilter);
            setBtnEnable(false);*/
            // process(fontPath, borderPath, imagePath, list);
          }
          activity.setBtnEnable(true);
        }
      }
    }
 public AccessPoint(Context context, Bundle savedState) {
   mContext = context;
   mConfig = savedState.getParcelable(KEY_CONFIG);
   if (mConfig != null) {
     loadConfig(mConfig);
   }
   if (savedState.containsKey(KEY_SSID)) {
     ssid = savedState.getString(KEY_SSID);
   }
   if (savedState.containsKey(KEY_SECURITY)) {
     security = savedState.getInt(KEY_SECURITY);
   }
   if (savedState.containsKey(KEY_PSKTYPE)) {
     pskType = savedState.getInt(KEY_PSKTYPE);
   }
   mInfo = (WifiInfo) savedState.getParcelable(KEY_WIFIINFO);
   if (savedState.containsKey(KEY_NETWORKINFO)) {
     mNetworkInfo = savedState.getParcelable(KEY_NETWORKINFO);
   }
   if (savedState.containsKey(KEY_SCANRESULTCACHE)) {
     ArrayList<ScanResult> scanResultArrayList =
         savedState.getParcelableArrayList(KEY_SCANRESULTCACHE);
     mScanResultCache.evictAll();
     for (ScanResult result : scanResultArrayList) {
       mScanResultCache.put(result.BSSID, result);
     }
   }
   update(mConfig, mInfo, mNetworkInfo);
   mRssi = getRssi();
   mSeen = getSeen();
 }
 @Override
 protected void onPostExecute(Bundle result) {
   ArrayList<SocialPerson> arraylist = result.getParcelableArrayList(RESULT_USERS_ARRAY);
   if (!handleRequestResult(result, REQUEST_GET_PERSONS)) return;
   ((OnRequestSocialPersonsCompleteListener) mLocalListeners.get(REQUEST_GET_PERSONS))
       .onRequestSocialPersonsSuccess(getID(), arraylist);
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_top_tracks, container, false);
    topTracksListView = (ListView) view.findViewById(R.id.topTrackslistView);
    searchingIcon = view.findViewById(R.id.loadingIcon);
    emptyMsg = (TextView) view.findViewById(R.id.emptyMsg);
    hideEmptyMsg();
    hideSearching();
    mTopTracks = new ArrayList<>();

    listAdapter = new MyAdapter(getActivity(), R.layout.track_item);
    topTracksListView.setAdapter(listAdapter);
    topTracksListView.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            mListener.onTrackSelected(listAdapter.getItem(position).getId(), mTopTracks);
          }
        });

    artistId = mListener.getArtistId();

    if (savedInstanceState != null) {
      mTopTracks = savedInstanceState.getParcelableArrayList(SAVE_TOP_TRACKS_LIST_KEY);
      setListWithNewValue();

    } else {
      new SearchTopTrackTask().execute();
    }

    return view;
  }
  @Override
  public void onReceiveResult(int resultCode, Bundle resultData) {
    switch (resultCode) {
      case DownloadService.STATUS_RUNNING:
        Logger.log("download_service", "STATUS_RUNNING");
        break;
      case DownloadService.STATUS_FINISHED:
        /* Hide progress & extract result from bundle */
        List<Film> downFilms = resultData.getParcelableArrayList("films");
        ((App) getActivity().getApplicationContext()).downloadedFilms = downFilms;

        setFilms(downFilms);
        /* Update ListView with result */
        Logger.log("download_service", "STATUS_FINISHED");
        break;
      case DownloadService.STATUS_ERROR:
        /* Handle the error */
        String error = resultData.getString(Intent.EXTRA_TEXT);

        if (getActivity() != null) {
          Toast.makeText(getActivity(), R.string.download_error, Toast.LENGTH_LONG).show();
        }
        Logger.log("download_service", "STATUS_ERROR: " + error);
        break;
    }
  }
Exemple #12
0
 /**
  * Create the markers and add them to the MarkerOverlay Gets it from the Intent or from the
  * savedInstanceState Assign them the proper <GeoPoint> if missing
  *
  * @param savedInstanceState
  */
 private void createMarkers(Bundle savedInstanceState) {
   List<MarkerDTO> markerDTOs;
   // add the OverlayItem to the ArrayItemizedOverlay
   ArrayList<DescribedMarker> markers;
   if (savedInstanceState != null) {
     markerDTOs = savedInstanceState.getParcelableArrayList(PARAMETERS.MARKERS);
     markers = MarkerUtils.markerDTO2DescribedMarkers(this, markerDTOs);
   } else {
     markerDTOs = getIntent().getParcelableArrayListExtra(PARAMETERS.MARKERS);
     markers = MarkerUtils.markerDTO2DescribedMarkers(this, markerDTOs);
     // retrieve geopoint if missing
     if (getIntent().getExtras() == null) {
       return;
     }
     featureIdField = getIntent().getExtras().getString(PARAMETERS.FEATURE_ID_FIELD);
     if (featureIdField == null) {
       featureIdField = FEATURE_DEFAULT_ID;
     }
     if (!MarkerUtils.assignFeaturesFromDb(markers, featureIdField)) {
       Toast.makeText(this, R.string.error_unable_getfeature_db, Toast.LENGTH_LONG).show();
       canConfirm = false;
       // TODO dialog : download features for this area?
     }
   }
   // create an ItemizedOverlay with the default marker
   overlayManager.getMarkerOverlay().getOverlayItems().addAll(markers);
 }
 protected void onRestoreInstanceState(Bundle savedInstanceState) {
   ArrayList<Uri> uris = savedInstanceState.getParcelableArrayList(TEMP_WALLPAPER_TILES);
   for (Uri uri : uris) {
     addTemporaryWallpaperTile(uri, true);
   }
   mSelectedIndex = savedInstanceState.getInt(SELECTED_INDEX, -1);
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.activity_map);
    /* ActionBar items */
    try {
      getActionBar().setHomeButtonEnabled(true);
      getActionBar().setDisplayHomeAsUpEnabled(true);
    } catch (NullPointerException e) {
      Toast.makeText(this, "Something went wrong. Try again.", Toast.LENGTH_SHORT).show();
    }
    ICON_HEIGHT = getResources().getDimensionPixelSize(R.dimen.mapIconHeight);

    // Toast.makeText(this, "onCreate", Toast.LENGTH_SHORT).show();
    FragmentManager fm = getFragmentManager();
    /* Obtain a reference to the UI element */
    MapFragment frag = (MapFragment) fm.findFragmentById(R.id.overworld);

    /* Obtain a reference to GoogleMap object associated with the fragment */
    worldMap = frag.getMap();
    mapClient = new LocationClient(this, this, this);
    mapClient = new LocationClient(this, this, this);
    ePrefs = PreferenceManager.getDefaultSharedPreferences(this);
    Boolean infoShown = ePrefs.getBoolean(infoDialoguePref, false);

    if (!infoShown) {
      String title = "Map Gallery";
      String text = getResources().getString(R.string.mapInfo);
      new AlertDialog.Builder(this)
          .setTitle(title)
          .setMessage(text)
          .setPositiveButton(
              android.R.string.ok,
              new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                  dialog.dismiss();
                }
              })
          .show();
      SharedPreferences.Editor editor = ePrefs.edit();
      editor.putBoolean(infoDialoguePref, true);
      editor.commit();
    }

    if (savedInstanceState != null) {
      zoomlevel = savedInstanceState.getFloat("zoom");
      loaded = savedInstanceState.getBoolean("loaded");
      currentLat = savedInstanceState.getDouble("lat");
      currentLng = savedInstanceState.getDouble("lng");
      fileToReload = savedInstanceState.getString("redo");

      dataRestorer =
          new DataRestorer(
              savedInstanceState.getStringArrayList("allFiles"),
              savedInstanceState.getParcelableArrayList("allBitmaps"),
              savedInstanceState.getFloatArray("allLat"),
              savedInstanceState.getFloatArray("allLng"));
    }
  }
  @Override
  public void loadState(Bundle bundle) {
    tags = bundle.getParcelableArrayList("tags");
    if (tags != null) {
      presenter.showTags(tags);
    } else {
      presenter.showError(new Throwable(ErrorEvent.LOAD_STATE_LIST_TAG));
    }

    popularTags = bundle.getParcelableArrayList("popular_tags");
    if (popularTags != null) {
      presenter.showPopularTags(popularTags);
    } else {
      presenter.showError(new Throwable(ErrorEvent.LOAD_STATE_POPULAR_TAGS));
    }
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_spotify, container, false);
    ListView listViewArtists = (ListView) rootView.findViewById(R.id.list_artists);
    List<MyArtist> listAdapter;

    if (savedInstanceState == null || !savedInstanceState.containsKey("myArtistListQuery")) {
      listAdapter = new ArrayList<MyArtist>();
    } else {
      listAdapter = savedInstanceState.getParcelableArrayList("myArtistListQuery");
      myArtistListQuery = (ArrayList) listAdapter;
    }

    customAdapterSpotify = new CustomAdapterSpotify(getActivity(), listAdapter);

    listViewArtists.setAdapter(customAdapterSpotify);

    listViewArtists.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {

          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            MyArtist artist = customAdapterSpotify.getItem(position);
            ((Callback) getActivity()).onItemSelected(artist.getId());
          }
        });

    return rootView;
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle bundle = getArguments();

    if (bundle == null) {
      getActivity().finish();
      return;
    }

    viewType = bundle.getString(KEY_VIEW_TYPE);

    nodes = bundle.getParcelableArrayList(KEY_NODES);
    if (nodes == null) {
      nodes = new ArrayList<>();
    }

    parentNode = bundle.getParcelable(KEY_PARENT_NODE);

    // If we're in provider root folder (first folder in given provider)
    if (parentNode != null && Utils.isProvider(parentNode)) {
      setHasOptionsMenu(true);
    }
  }
Exemple #18
0
  @Override
  public void onViewCreated(final View view, @Nullable final Bundle state) {
    super.onViewCreated(view, state);

    mRefreshLayout.setOnRefreshListener(
        new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
            UIUtils.updateEmptyViewState(getView(), mRecyclerView, mAdapter.isEmpty());
            reloadTheFirstPage();
          }
        });
    mRecyclerView.setAdapter(mAdapter);

    if (!mAdapter.isEmpty()) {
      return;
    }
    if (state == null) {
      loadTheFirstPage();
    } else {
      final List<AugmentedQuote> quotes = state.getParcelableArrayList(SAVED_ADAPTER_STATE);
      if (Utils.isCollectionEmpty(quotes)) {
        loadTheFirstPage();
      } else {
        // This should give a non-zero integer
        mTotalPages = state.getInt(PAGES_SAVED_STATE);
        mInfiniteScrollListener =
            new InfiniteRecyclerLoadHelper(
                mRecyclerView, new InfiniteLoadCallback(), mTotalPages, null);
        addDataToAdapter(quotes);
      }
    }
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_editor);
    ButterKnife.bind(this);

    setSupportActionBar(editorToolbar);
    editorToolbar.setNavigationIcon(R.mipmap.ic_back);
    editorToolbar.setTitleTextColor(getResources().getColor(R.color.white));
    editorToolbar.setNavigationOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            finish();
          }
        });

    Intent intent = getIntent();
    List<Editor> list = new ArrayList<Editor>();
    Bundle bundle = new Bundle();
    bundle = intent.getBundleExtra("EditorList");
    list = bundle.getParcelableArrayList("EditorList");
    EditorListFragment editorListFragment = new EditorListFragment();
    editorListFragment.setData(list);
    getSupportFragmentManager()
        .beginTransaction()
        .replace(R.id.editor_fragment_container, editorListFragment)
        .commit();
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.city_listview);

    // Receive the data passed from MainActivity
    Bundle params = getIntent().getExtras();

    this.setTitle("Choose a city to load from:");

    // Construct the cities list
    Vector<String> items = new Vector<String>();
    items.add("<Delete City>");

    List<Profile> allCities = db.getAllProfiles();
    for (int i = 0; i < allCities.size(); i++) {
      items.add((allCities.get(i)).cityName);
    }

    cityList = (ListView) findViewById(R.id.list);
    cityList.setOnItemClickListener(this);
    cityList.setOnItemLongClickListener(this);
    cities =
        new ArrayAdapter<String>(
            this, android.R.layout.simple_list_item_1, items.toArray(new String[0]));
    cityList.setAdapter(cities);

    // get the mainProfile from MainActivity
    newProfile = (Profile) params.getParcelableArrayList("profile").get(0);
  }
Exemple #21
0
  private void handleArgs(@Nullable Bundle args) {
    if (args == null) {
      mMultiView.setViewState(MultiStateView.VIEW_STATE_EMPTY);
      return;
    }

    List<Upload> uploads = null;

    if (args.containsKey(KEY_PASSED_FILE)) {
      LogUtil.v(TAG, "Received file from bundle");
      uploads = new ArrayList<>(1);
      uploads.add(new Upload(args.getString(KEY_PASSED_FILE)));
    } else if (args.containsKey(KEY_PASSED_LINK)) {
      mMultiView.setViewState(MultiStateView.VIEW_STATE_EMPTY);
      String link = args.getString(KEY_PASSED_LINK);
      getChildFragmentManager()
          .beginTransaction()
          .add(UploadLinkDialogFragment.newInstance(link), UploadLinkDialogFragment.TAG)
          .commit();
    } else if (args.containsKey(KEY_PASSED_URIS)) {
      ArrayList<Uri> photoUris = args.getParcelableArrayList(KEY_PASSED_URIS);

      if (photoUris != null && !photoUris.isEmpty()) {
        LogUtil.v(TAG, "Received " + photoUris.size() + " images via Share intent");
        new DecodeImagesTask(this).execute(photoUris);
        mMultiView.setViewState(MultiStateView.VIEW_STATE_LOADING);
      }
    }

    if (uploads != null && !uploads.isEmpty()) {
      mAdapter = new UploadPhotoAdapter(getActivity(), uploads, this);
      mRecyclerView.setAdapter(mAdapter);
      mMultiView.setViewState(MultiStateView.VIEW_STATE_CONTENT);
    }
  }
  @Override
  public void onReceiveResult(int resultCode, Bundle resultData) {
    switch (resultCode) {
      case FilmDownloadService.STATUS_RUNNING:
        // setProgressBarIndeterminateVisibility(true);
        Log.i("oliver", "Downloading...");
        break;
      case FilmDownloadService.STATUS_FINISHED:
        Log.i("oliver", "Downloading finished");
        /* Hide progress & extract result from bundle */
        // setProgressBarIndeterminateVisibility(false);
        sDOWNLOADED_FILMS = resultData.getParcelableArrayList(FilmDownloadService.RESULT_KEY);
        Log.i("oliver", "Results: " + sDOWNLOADED_FILMS);

        /* Update ListView with result */
        if (!mIsFavoritesChecked && !sDOWNLOADED_FILMS.isEmpty()) {
          this.setDownloadedFilmsData();
        }
        break;
      case FilmDownloadService.STATUS_ERROR:
        /* Handle the error */
        String error = resultData.getString(Intent.EXTRA_TEXT);
        Toast.makeText(this.getActivity(), error, Toast.LENGTH_LONG).show();
        break;
    }
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rl = (RelativeLayout) inflater.inflate(R.layout.fragment_transactions, container, false);
    Bundle args = getArguments();
    if (args.containsKey("account")) {
      account = (args.getParcelable("account"));
    }

    transactionsListView = (ListView) rl.findViewById(R.id.transactionsListView);
    if (savedInstanceState != null) {
      transactionList = (savedInstanceState.getParcelableArrayList("transactions"));
    } else {
      transactionList = new ArrayList<Transaction>();
      GetTransactionsTask getTransactionsTask = new GetTransactionsTask();
      getTransactionsTask.execute(String.valueOf(account.account_id));
      SetLoadingAnimation(true);
    }
    transactionListAdapter = new TransactionListAdapter(this.getActivity(), transactionList);
    transactionsListView.setAdapter(transactionListAdapter);
    transactionListAdapter.notifyDataSetChanged();

    gestureScanner = new GestureDetector(this.getActivity(), this);
    transactionsListView.setOnTouchListener(
        new OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
            return gestureScanner.onTouchEvent(event);
          }
        });
    return rl;
  }
Exemple #24
0
 // Al crearse la actividad.
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);
   // Se restauran los datos si provenimos de un cambio de orientación.
   if (savedInstanceState == null) {
     mDatos = new ArrayList<Foto>();
   } else {
     mDatos = savedInstanceState.getParcelableArrayList(STATE_LISTA_DATOS);
     mMaxTagId = savedInstanceState.getString(STATE_MAX_TAG_ID);
   }
   initVistas();
   // Se obtiene la interfaz de acceso a la api.
   mApiClient = Instagram.getApiInterface(this);
   // Se cargan los datos iniciales.
   if (savedInstanceState == null) {
     mDatos = new ArrayList<Foto>();
     swlPanel.post(
         new Runnable() {
           @Override
           public void run() {
             swlPanel.setRefreshing(true);
             onRefresh();
           }
         });
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // 获取传递的特殊数据
    Bundle bundle = getIntent().getExtras();
    lists_note = bundle.getStringArrayList("lists_note");

    list_infos = bundle.getParcelableArrayList("list_infos");

    instructions_value = bundle.getString("instructions_value");
    instructions_date = bundle.getString("date");
    instructions_person = bundle.getString("maker");

    patient_info_id = bundle.getInt("patient_info_id");
    user_auth_id = bundle.getInt("user_auth_id");
    position = bundle.getInt("position");
    main_position = bundle.getInt("main_position");
    menu_lib_id = bundle.getString("menu_lib_id");

    indexTextName = bundle.getString("indexTextName");

    initData();
    initListener();

    // 网络返回数据后得到通知刷新View
    handler =
        new Handler() {
          @Override
          public void handleMessage(Message msg) {
            super.handleMessage(msg);
            switch (msg.what) {
              case 1:
                // progressBar.setVisibility(View.GONE);
                if (200 == create_code) {
                  // 发广播
                  Intent intent = new Intent(TableChildInfoActivity.ACTION_INTENT_TABLE_ADD);
                  intent.putExtra("spinner_value", spinner_value);
                  L.d("aa", "sos--create-----spinner_value-------------------" + spinner_value);
                  sendBroadcast(intent);
                  finish();
                  ShowToast.Short(getString(R.string.msg_save_success));
                } else if (200 == update_code) {
                  // 发广播
                  Intent intent1 = new Intent(TableChildInfoActivity.ACTION_INTENT_TABLE_EDIT);
                  intent1.putExtra("spinner_value", spinner_value);
                  sendBroadcast(intent1);
                  finish();
                  ShowToast.Short(getString(R.string.msg_update_success));
                } else if (100 == create_code || 500 == create_code) {
                  ShowToast.Short(getString(R.string.msg_save_fail));
                } else if (100 == update_code || 500 == create_code) {
                  ShowToast.Short(getString(R.string.msg_update_fail));
                }
                break;
            }
          }
        };
  }
Exemple #26
0
 public final boolean handleMessage(Message paramMessage) {
   dnl localdnl;
   fj[] arrayOffj;
   SlideshowService localSlideshowService;
   Bundle localBundle;
   int i;
   Context localContext;
   String str1;
   String str2;
   String str3;
   boolean bool1;
   boolean bool2;
   Object localObject;
   if (paramMessage.what == 1) {
     localdnl = new dnl(this.a);
     arrayOffj = new fj[1];
     localSlideshowService = this.a;
     localBundle = this.a.b;
     i = localBundle.getInt("account_id", -1);
     localContext = localSlideshowService.getApplicationContext();
     str1 = localBundle.getString("view_id");
     str2 = localBundle.getString("tile_id");
     str3 = localBundle.getString("photo_id");
     bool1 = localBundle.getBoolean("oob_only", false);
     bool2 = localBundle.getBoolean("show_oob_tile", false);
     long l = localBundle.getLong("all_photos_row_id");
     int j = localBundle.getInt("all_photos_offset", 0);
     if (!localSlideshowService.f) {
       break label169;
     }
     localObject = new aqb(localContext, i, null, Long.valueOf(l), j, 10000, 0);
   }
   for (; ; ) {
     arrayOffj[0] = localObject;
     localdnl.execute(arrayOffj);
     return true;
     label169:
     if (localSlideshowService.e) {
       boolean bool3 = localBundle.containsKey("shareables");
       ArrayList localArrayList = null;
       if (bool3) {
         localArrayList = localBundle.getParcelableArrayList("shareables");
       }
       ipf localipf = (ipf) localBundle.getParcelable("photo_ref");
       localObject =
           new dch(
               localContext,
               localArrayList,
               localBundle.getInt("filter", 0),
               localipf,
               str1,
               null);
     } else {
       localObject =
           new def(
               localContext, i, str1, str2, str3, bool2, bool1, localBundle.getInt("filter", 0));
     }
   }
 }
  private void onRestoreInstanceState(Bundle state) {
    mAction = state.getString(KEY_ACTION);
    mGroupUri = state.getParcelable(KEY_GROUP_URI);
    mGroupId = state.getLong(KEY_GROUP_ID);

    mStatus = (Status) state.getSerializable(KEY_STATUS);
    mAccountName = state.getString(KEY_ACCOUNT_NAME);
    mAccountType = state.getString(KEY_ACCOUNT_TYPE);
    mDataSet = state.getString(KEY_DATA_SET);

    mGroupNameIsReadOnly = state.getBoolean(KEY_GROUP_NAME_IS_READ_ONLY);
    mOriginalGroupName = state.getString(KEY_ORIGINAL_GROUP_NAME);

    mListMembersToAdd = state.getParcelableArrayList(KEY_MEMBERS_TO_ADD);
    mListMembersToRemove = state.getParcelableArrayList(KEY_MEMBERS_TO_REMOVE);
    mListToDisplay = state.getParcelableArrayList(KEY_MEMBERS_TO_DISPLAY);
  }
Exemple #28
0
  public RssFeed(Parcel source) {

    Bundle data = source.readBundle();
    title = data.getString("title");
    link = data.getString("link");
    description = data.getString("description");
    language = data.getString("language");
    rssItems = data.getParcelableArrayList("rssItems");
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_new_post, container, false);
    mPostText = (MultiAutoCompleteTextView) rootView.findViewById(R.id.postText);
    mUsersListAdapter = new UserCompletionAdapter(getActivity());
    mPostText.setAdapter(mUsersListAdapter);
    mPostText.setTokenizer(new SymbolTokenizer('@'));
    mIsPrivate = (Switch) rootView.findViewById(R.id.isPrivate);
    mTagsListAdapter =
        new ArrayAdapter<>(getActivity(), android.R.layout.simple_dropdown_item_1line);
    mPostTags = (MultiAutoCompleteTextView) rootView.findViewById(R.id.postTags);
    mPostTags.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
    mPostTags.setAdapter(mTagsListAdapter);
    mImagesPanel = (ImageUploadingPanel) rootView.findViewById(R.id.imagesPanel);
    setHasOptionsMenu(true);
    if (savedInstanceState == null) {
      Bundle args = getArguments();
      if (args != null) {
        mPostId = args.getString(ARG_ID);
        mPostText.setText(args.getString(ARG_TEXT, ""));
        String[] tags = args.getStringArray(ARG_TAGS);
        mIsPrivate.setChecked(args.getBoolean(ARG_PRIVATE));
        if (tags != null) {
          mPostTags.setText(TextUtils.join(", ", tags));
        }
        ArrayList<Uri> images = args.getParcelableArrayList(ARG_IMAGES);
        if (images != null)
          for (Uri image : images) {
            mImagesPanel.addImage(image, mMime);
          }
        mMime = args.getString(ARG_MIME);
      }
    }
    if (mPostId == null) {
      mIsPrivate.setVisibility(View.VISIBLE);
    } else {
      mIsPrivate.setVisibility(View.GONE);
    }
    mProgressDialog =
        new MaterialDialog.Builder(getActivity())
            .cancelable(false)
            .customView(R.layout.dialog_progress, false)
            .build();

    TagsRequest request = new TagsRequest(PointConnectionManager.getInstance().loginResult.login);
    getSpiceManager()
        .getFromCacheAndLoadFromNetworkIfExpired(
            request, request.getCacheName(), DurationInMillis.ONE_DAY, mTagsRequestListener);
    UserSubscriptionsRequest request2 =
        new UserSubscriptionsRequest(PointConnectionManager.getInstance().loginResult.login);
    getSpiceManager()
        .getFromCacheAndLoadFromNetworkIfExpired(
            request2, request2.getCacheName(), DurationInMillis.ONE_DAY, mUsersRequestListener);
    return rootView;
  }
 /** @param savedInstanceState */
 private void getSaveData(Bundle savedInstanceState) {
   if (savedInstanceState != null) {
     page = savedInstanceState.getInt("page", 1);
     isEnd = savedInstanceState.getBoolean("isEnd");
     isRefresh = savedInstanceState.getBoolean("isRefresh");
     dataList = savedInstanceState.getParcelableArrayList("dataList");
   } else if (bound) {
     requestInternetData();
   }
 }