@Override
 public void onSaveInstanceState(Bundle savedInstanceState) {
   super.onSaveInstanceState(savedInstanceState);
   savedInstanceState.putString(KEY_STRING, text.getText().toString());
   savedInstanceState.putSerializable(KEY_EVENT, event);
   savedInstanceState.putSerializable(KEY_SHOW_BUTTON, current_event_registered);
 }
Esempio n. 2
0
  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    int count = lv.getChildCount();
    for (int i = 0; i < count; i++) {
      LinearLayout linearLayout = (LinearLayout) lv.getChildAt(i);
      LinearLayout linearLayoutChild = (LinearLayout) linearLayout.getChildAt(0);
      EditText editText = (EditText) linearLayoutChild.getChildAt(1);
      if (editText.isShown()) {
        String value = editText.getText().toString();
        EnterCompanyListAdapter.ViewHolder viewHolder = (ViewHolder) linearLayout.getTag();
        viewHolder.fieldAndAnswer.set(1, value);
      }
    }

    @SuppressWarnings("unused")
    int count2 = epla.getCount();
    for (int i = 0; i < epla.getCount(); i++) {
      @SuppressWarnings("unchecked")
      ArrayList<String> fieldAndAnswer = (ArrayList<String>) epla.getItem(i);
      String fieldName = fieldAndAnswer.get(0);
      String value = fieldAndAnswer.get(1);
      company.set(fieldName, value);
    }

    outState.putSerializable("company", company);
    outState.putSerializable("person", person);
    outState.putBoolean("personLinked", personLinked);
  }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putSerializable("bikeNetwork", bikeNetwork);
   outState.putSerializable("stations", stations);
   outState.putSerializable("favStations", favStations);
 }
  /*
   * Map methods
   */
  public static void staticOnMarkerClick(
      SherlockFragmentActivity mActivity,
      GoogleMap map,
      Marker marker,
      OnDetailsClick onDetailsClickImplementation) {
    String id = marker.getTitle();

    List<LocatedObject> list = MapManager.ClusteringHelper.getFromGridId(id);

    if (list == null || list.isEmpty()) {
      return;
    }

    if (list.size() > 1 && map.getCameraPosition().zoom == map.getMaxZoomLevel()) {
      AlertRoadsInfoDialog infoDialog = new AlertRoadsInfoDialog(onDetailsClickImplementation);
      Bundle args = new Bundle();
      args.putSerializable(AlertRoadsInfoDialog.ARG_ALERTSLIST, (ArrayList) list);
      infoDialog.setArguments(args);
      infoDialog.show(mActivity.getSupportFragmentManager(), "dialog");
    } else if (list.size() > 1) {
      map.animateCamera(
          CameraUpdateFactory.newLatLngZoom(
              marker.getPosition(), map.getCameraPosition().zoom + 1));
      MapManager.fitMapWithOverlays(list, map);
    } else {
      AlertRoadLoc alert = (AlertRoadLoc) list.get(0);
      AlertRoadsInfoDialog infoDialog = new AlertRoadsInfoDialog(onDetailsClickImplementation);
      Bundle args = new Bundle();
      args.putSerializable(AlertRoadsInfoDialog.ARG_ALERT, alert);
      infoDialog.setArguments(args);
      infoDialog.show(mActivity.getSupportFragmentManager(), "dialog");
    }
  }
Esempio n. 5
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   // TODO Auto-generated method stub
   outState.putSerializable("priceString", orderFragment.getPrice());
   outState.putSerializable("priceInt", orderFragment.getPrice_int());
   super.onSaveInstanceState(outState);
 }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putSerializable("bean", bean);
   outState.putSerializable("userBean", userBean);
   outState.putString("token", token);
 }
Esempio n. 7
0
  private void parseCanLoanCompanyResponse(JSONObject response) throws JSONException {
    if (response.has("status") && "0".equals(response.get("status"))) {
      try {
        JSONObject photos = response.getJSONObject("data");
        JSONArray jsonArray = photos.getJSONArray("companyList");

        if (jsonArray.length() > 0) {
          for (int index = 0; index < jsonArray.length(); index++) {
            JSONObject jsonObj = jsonArray.getJSONObject(index);
            Gson gson = new Gson();
            CompanyModel companyModel = gson.fromJson(jsonObj.toString(), CompanyModel.class);
            list.add(companyModel);
          }
        }

        Intent intent = new Intent(AnswerConditionActivity.this, CheckLoanActivity.class);
        Bundle bundle = new Bundle();
        bundle.putSerializable("list", list);
        bundle.putSerializable("answerModel", answerModel);
        intent.putExtras(bundle);
        startActivity(intent);
        finishActivity();

      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      showToast(AnswerConditionActivity.this, "提交失败");
    }
  }
  @Override
  public TaskResult doWork(ContextWrapper ctx) {

    TaskResult taskResult = new TaskResult();

    List<Status> notifiableStatues = loadStatuses(ctx);

    for (Status status : notifiableStatues) {
      NotificationMessage notification = new NotificationMessage(getTitle(), status.text);
      notification.setNotificationId(Integer.valueOf(status.id));
      notification.setNotificationIconResource(R.drawable.ic_status_notification);

      Bundle extras = new Bundle();

      if (status.isActivityType() || status.isHelpType()) {
        notification.setNotificationClickIntentClass(StatusDetailActivity.class);
        extras.putSerializable(StatusDetailActivity.EXTRAS_STATUS, status);
        extras.putSerializable(StatusDetailActivity.EXTRAS_ENABLE_GO_TO_WALL_ACTION, false);
        extras.putSerializable(StatusDetailActivity.EXTRAS_IS_FROM_NOTIFICATION, true);
        notification.setNotificationClickIntentBundle(extras);
        notification.setFlagResource(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

      } else if (status.isLogType()) {
        // TODO abrir notificacao de novas aulas
      }

      taskResult.addMessage(notification);
    }

    return taskResult;
  }
Esempio n. 9
0
  @TargetApi(Build.VERSION_CODES.KITKAT)
  public void switchLocaleLanguage(View view) {
    // detect which language is currently set and switch to the alternative
    String lang;
    if (Objects.equals(Locale.getDefault().getLanguage(), "en")) {
      lang = "nl";
    } else {
      lang = "en";
    }

    Locale locale = new Locale(lang);
    Locale.setDefault(locale);
    Configuration config = new Configuration();
    config.locale = locale;
    getBaseContext()
        .getResources()
        .updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());

    // store the language in sharedpreferences
    SharedPreferences prefs =
        this.getSharedPreferences(
            getResources().getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    prefs.edit().putString("system_lang", lang).apply();

    // refresh activity for locale changes to take effect
    Bundle extras = new Bundle();
    extras.putSerializable("gameID", game.getId());
    extras.putBoolean("flag_EN", dictionaryEnglish);
    extras.putSerializable("p1", player1);
    extras.putSerializable("p2", player2);
    Intent i = new Intent(this, GameActivity.class).putExtras(extras);
    startActivity(i);
    this.finish();
  }
  @Override
  public void onClick(View v) {
    int id = v.getId();
    resetSelection();

    if (id == R.id.history) {
      changeCurrentFragment(FragmentsAvailable.HISTORY, null);
      history.setSelected(true);
      LinphoneManager.getLc().resetMissedCallsCount();
      displayMissedCalls(0);
    } else if (id == R.id.contacts) {
      changeCurrentFragment(FragmentsAvailable.CONTACTS, null);
      contacts.setSelected(true);
    } else if (id == R.id.dialer) {
      changeCurrentFragment(FragmentsAvailable.DIALER, null);
      dialer.setSelected(true);
    } else if (id == R.id.settings) {
      changeCurrentFragment(FragmentsAvailable.SETTINGS, null);
      settings.setSelected(true);
    } else if (id == R.id.about_chat) {
      Bundle b = new Bundle();
      b.putSerializable("About", FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT);
      changeCurrentFragment(FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT, b);
      aboutChat.setSelected(true);
    } else if (id == R.id.about_settings) {
      Bundle b = new Bundle();
      b.putSerializable("About", FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS);
      changeCurrentFragment(FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS, b);
      aboutSettings.setSelected(true);
    } else if (id == R.id.chat) {
      changeCurrentFragment(FragmentsAvailable.CHATLIST, null);
      chat.setSelected(true);
    }
  }
Esempio n. 11
0
  public void execute() {
    // Initialize a Reminder or more than one Reminders.
    boolean booleanReminder = false;
    if (mStrReminder.compareTo(mStrReminder) == 0) booleanReminder = true;
    Reminder[] reminders = new Reminder[1];
    if (mStrMinute.compareTo("On day of event") == 0) {
      Date dateReminder = getDateTime(mStrStartTime);
      GregorianCalendar gregorianCalendarReminder = new GregorianCalendar();
      gregorianCalendarReminder.setTime(dateReminder);
      mStrMinute =
          Integer.toString(
              gregorianCalendarReminder.get(Calendar.HOUR_OF_DAY) * 60
                  + gregorianCalendarReminder.get(Calendar.MINUTE));
    }

    reminders[0] = new Reminder(mStrMinute, mStrMethod, booleanReminder);

    // Initialize a Recurrence.

    // Initialize a Where.
    Where where = new Where(mStrLocation);

    // Initialize a When.
    When when =
        new When(
            getStrDateWithTimeZone(mStrStartTime), getStrDateWithTimeZone(mStrEndTime), reminders);

    // Initialize an Event.
    Event event = new Event(mStrTitle, mStrContent, where, when);

    // Post to Calendar for adding a new event of default calendar.
    Event eventNew = null;
    try {
      eventNew = mCalendarServer.postEventEntry("", event);
    } catch (IOException e) {
      Bundle bundleSend = new Bundle();
      eventNew = new Event(false);
      bundleSend.putSerializable("Data", eventNew);
      bundleSend.putInt("ErrorCode", Integer.parseInt(e.getMessage()));

      Intent intentSend = new Intent(IntentCommand.INTENT_ACTION);
      intentSend.setFlags(IntentCommand.GOOGLE_CALENDAR_ADD_EVENT);
      intentSend.putExtras(bundleSend);

      mBaseService.sendBroadcast(intentSend);
      return;
    }

    // Get a response from Calendar, the response is a event entry, update cache.
    if (eventNew != null) {
      Bundle bundleSend = new Bundle();
      bundleSend.putSerializable("Data", eventNew);

      Intent intentSend = new Intent(IntentCommand.INTENT_ACTION);
      intentSend.setFlags(IntentCommand.GOOGLE_CALENDAR_ADD_EVENT);
      intentSend.putExtras(bundleSend);

      mBaseService.sendBroadcast(intentSend);
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fex_detail);

    // Don't show the Up button in the action bar.
    getSupportActionBar().setDisplayHomeAsUpEnabled(false);

    // savedInstanceState is non-null when there is fragment state
    // saved from previous configurations of this activity
    // (e.g. when rotating the screen from portrait to landscape).
    // In this case, the fragment will automatically be re-added
    // to its container so we don't need to manually add it.
    // For more information, see the Fragments API guide at:
    //
    // http://developer.android.com/guide/components/fragments.html
    //
    if (savedInstanceState == null) {
      // Create the detail fragment and add it to the activity
      // using a fragment transaction.
      Bundle arguments = new Bundle();
      arguments.putSerializable(
          FExDetailFragment.ARG_FEX, getIntent().getSerializableExtra(FExDetailFragment.ARG_FEX));
      arguments.putSerializable(
          FExDetailFragment.ARG_WORKOUT,
          getIntent().getSerializableExtra(FExDetailFragment.ARG_WORKOUT));
      FExDetailFragment fragment = new FExDetailFragment();
      fragment.setArguments(arguments);
      getSupportFragmentManager()
          .beginTransaction()
          .add(R.id.exercise_detail_container, fragment)
          .commit();
    }
  }
Esempio n. 13
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   outState.putSerializable(STATE_ADDRESS, address);
   outState.putBoolean(STATE_ADDRESS_CAN_CHANGE_TYPE, addressTypeCanChange);
   outState.putSerializable(STATE_AMOUNT, sendAmount);
   outState.putSerializable(STATE_AMOUNT_TYPE, sendAmountType);
 }
  /**
   * Callback method from {@link FExListFragment.Callbacks} indicating that the item with the given
   * ID was selected.
   */
  @Override
  public void onItemSelected(FitnessExercise ex) {
    if (mTwoPane) {
      // In two-pane mode, show the detail view in this activity by
      // adding or replacing the detail fragment using a
      // fragment transaction.
      Bundle arguments = new Bundle();
      arguments.putSerializable(FExDetailFragment.ARG_FEX, ex);
      arguments.putSerializable(FExDetailFragment.ARG_WORKOUT, mWorkout);
      FExDetailFragment fragment = new FExDetailFragment();
      fragment.setArguments(arguments);
      getSupportFragmentManager()
          .beginTransaction()
          .replace(R.id.exercise_detail_container, fragment)
          .commit();

    } else {
      // In single-pane mode, simply start the detail activity
      // for the selected item ID.
      Intent detailIntent = new Intent(this, FExDetailActivity.class);
      detailIntent.putExtra(FExDetailFragment.ARG_FEX, ex);
      detailIntent.putExtra(FExDetailFragment.ARG_WORKOUT, mWorkout);
      startActivityForResult(detailIntent, FExListActivity.RESULT_WORKOUT);
    }
  }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putSerializable("bean", bean);
   outState.putSerializable("userBean", userBean);
   outState.putInt("page", page);
 }
 @Override
 public void onSaveInstanceState(@NonNull Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putInt(KEY_SELECTED_YEAR, mCalendar.get(Calendar.YEAR));
   outState.putInt(KEY_SELECTED_MONTH, mCalendar.get(Calendar.MONTH));
   outState.putInt(KEY_SELECTED_DAY, mCalendar.get(Calendar.DAY_OF_MONTH));
   outState.putInt(KEY_WEEK_START, mWeekStart);
   outState.putInt(KEY_YEAR_START, mMinYear);
   outState.putInt(KEY_YEAR_END, mMaxYear);
   outState.putInt(KEY_CURRENT_VIEW, mCurrentView);
   int listPosition = -1;
   if (mCurrentView == MONTH_AND_DAY_VIEW) {
     listPosition = mDayPickerView.getMostVisiblePosition();
   } else if (mCurrentView == YEAR_VIEW) {
     listPosition = mYearPickerView.getFirstVisiblePosition();
     outState.putInt(KEY_LIST_POSITION_OFFSET, mYearPickerView.getFirstPositionOffset());
   }
   outState.putInt(KEY_LIST_POSITION, listPosition);
   outState.putSerializable(KEY_MIN_DATE, mMinDate);
   outState.putSerializable(KEY_MAX_DATE, mMaxDate);
   outState.putSerializable(KEY_HIGHLIGHTED_DAYS, highlightedDays);
   outState.putSerializable(KEY_SELECTABLE_DAYS, selectableDays);
   outState.putBoolean(KEY_THEME_DARK, mThemeDark);
   outState.putBoolean(KEY_VIBRATE, mVibrate);
 }
Esempio n. 17
0
 public static EditPoiDialogFragment createInstance(Node node, Amenity amenity) {
   EditPoiDialogFragment editPoiDialogFragment = new EditPoiDialogFragment();
   Bundle args = new Bundle();
   args.putSerializable(KEY_AMENITY_NODE, node);
   args.putSerializable(KEY_AMENITY, amenity);
   editPoiDialogFragment.setArguments(args);
   return editPoiDialogFragment;
 }
Esempio n. 18
0
  public static Bundle getStartExtras(HttpRequestInfo groupRequestInfo) {
    Bundle bundle = new Bundle();

    bundle.putSerializable(STARTUP_EXTRA, StartupExtra.GROUP_REQUEST);
    bundle.putSerializable(GROUP_REQUEST, groupRequestInfo);

    return bundle;
  }
Esempio n. 19
0
 public void editFilter(View view, Integer filterID) {
   Intent addEditFilterActivity = new Intent(view.getContext(), AddEditFilterActivity.class);
   Bundle b = new Bundle();
   b.putSerializable("catID", filterID);
   b.putSerializable("task", EDIT);
   addEditFilterActivity.putExtras(b);
   this.startActivityForResult(addEditFilterActivity, 5);
 }
Esempio n. 20
0
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putSerializable("view", this.view);
   outState.putInt("viewId", this.viewId);
   outState.putInt("callId", this.callId);
   outState.putInt("currentLoadingMsg", this.currentLoadingMsg);
   outState.putSerializable("command", this.command);
 }
 @Click(R.id.btnSell)
 public void clickBtnSell() {
   Bundle bundle = getArguments();
   bundle.putSerializable(Constants.EXTRA_DESCRIPTION, resultData);
   bundle.putSerializable(Constants.EXTRA_RATE_PRICE, bid);
   bundle.putSerializable(Constants.EXTRA_TYPE_OPERATION, OperationType.sell);
   ((BaseActivity) getActivity()).initFragment(new BuyAsset_(), getArguments());
 }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   Calendar cal = (Calendar) tStartDate.getTag();
   outState.putSerializable("StartDate", cal);
   cal = (Calendar) tEndDate.getTag();
   outState.putSerializable("EndDate", cal);
 }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   // save the current data, for instance when changing screen orientation
   outState.putSerializable("dataset", mDataset);
   outState.putSerializable("renderer", mRenderer);
   outState.putSerializable("current_series", mCurrentSeries);
   outState.putSerializable("current_renderer", mCurrentRenderer);
 }
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putSerializable("mNewUser", mNewUser);
    outState.putSerializable("user", mUser);
    outState.putSerializable("friendship", mFriendship);
    outState.putSerializable("groupListed", mGroupMemberListed);
  }
Esempio n. 25
0
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putLong("titleId", mTitleId);

    if (mPayload != null) outState.putSerializable("payload", mPayload);
    if (mIconCursor != null) outState.putSerializable("icons", mIconCursor);
  }
  public static DatePickerFragment newInstance(Date date, String pickerType) {
    Bundle args = new Bundle();
    args.putSerializable(ARG_DATE, date);
    args.putSerializable(ARG_PICKER_TYPE, pickerType);

    DatePickerFragment fragment = new DatePickerFragment();
    fragment.setArguments(args);
    return fragment;
  }
 public static BookEventDialog newInstance(Room room, Date startDate, Date endDate) {
   BookEventDialog frag = new BookEventDialog();
   Bundle args = new Bundle();
   args.putParcelable(Room.TAG, room);
   args.putSerializable(START_DATE, startDate);
   args.putSerializable(END_DATE, endDate);
   frag.setArguments(args);
   return frag;
 }
Esempio n. 28
0
 @Override
 public Parcelable saveState() {
   Bundle out = new Bundle(10);
   if (mAlbumAdapter != null) out.putSerializable("limiter_albums", mAlbumAdapter.getLimiter());
   if (mSongAdapter != null) out.putSerializable("limiter_songs", mSongAdapter.getLimiter());
   if (mFilesAdapter != null) out.putSerializable("limiter_files", mFilesAdapter.getLimiter());
   maintainPosition();
   return out;
 }
Esempio n. 29
0
 public static RedditFilterFragment createInstance(
     RedditSort sort, ImgurFilters.TimeSort topSort) {
   RedditFilterFragment fragment = new RedditFilterFragment();
   Bundle args = new Bundle(2);
   args.putSerializable(KEY_SORT, sort);
   args.putSerializable(KEY_TOP_SORT, topSort);
   fragment.setArguments(args);
   return fragment;
 }
Esempio n. 30
-1
    public void run() {

      FindGamesHandler handler = new FindGamesHandler(Looper.getMainLooper());
      Bundle data = new Bundle();
      Message msg = new Message();
      try {
        GamesTO gameCTO;
        //				if (city != null)
        gameCTO = gameService.findGamesByCity(city, 0, 10);

        data.putSerializable("gameArray", gameCTO.getGames().toArray(new GameTO[0]));
        data.putBoolean("hasMore", gameCTO.isHasMore());
        msg.setData(data);
        handler.sendMessage(msg);

      } catch (ServerException e) {
        data.putSerializable("ServerException", e);
        msg.setData(data);
        handler.sendMessage(msg);
      } catch (Exception e) {
        data.putSerializable("Exception", e);
        msg.setData(data);
        handler.sendMessage(msg);
      }
    }