@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mDbHelper = new NotesDbAdapter(this); mDbHelper.open(); setContentView(R.layout.note_edit); setTitle(R.string.edit_note); mTitleText = (EditText) findViewById(R.id.title); mBodyText = (EditText) findViewById(R.id.body); Button confirmButton = (Button) findViewById(R.id.confirm); mRowId = (savedInstanceState == null) ? null : (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID); if (mRowId == null) { Bundle extras = getIntent().getExtras(); mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID) : null; } populateFields(); confirmButton.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { setResult(RESULT_OK); finish(); } }); }
@Override public void onActivityCreated(Bundle savedInstanceState) { commander = ((AbstractAppActivity) getActivity()).getBitmapDownloader(); switch (getCurrentState(savedInstanceState)) { case FIRST_TIME_START: if (Utility.isTaskStopped(dbTask)) { dbTask = new DBCacheTask(); dbTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR); } break; case SCREEN_ROTATE: // nothing refreshLayout(getList()); break; case ACTIVITY_DESTROY_AND_CREATE: getList().addNewData((MessageListBean) savedInstanceState.getSerializable("bean")); userBean = (UserBean) savedInstanceState.getSerializable("userBean"); token = savedInstanceState.getString("token"); getAdapter().notifyDataSetChanged(); refreshLayout(bean); break; } super.onActivityCreated(savedInstanceState); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null && savedInstanceState.containsKey(KEY_HOUR_OF_DAY) && savedInstanceState.containsKey(KEY_MINUTE) && savedInstanceState.containsKey(KEY_IS_24_HOUR_VIEW)) { mInitialHourOfDay = savedInstanceState.getInt(KEY_HOUR_OF_DAY); mInitialMinute = savedInstanceState.getInt(KEY_MINUTE); mIs24HourMode = savedInstanceState.getBoolean(KEY_IS_24_HOUR_VIEW); mInKbMode = savedInstanceState.getBoolean(KEY_IN_KB_MODE); mStyleResId = savedInstanceState.getInt(KEY_STYLE); if (savedInstanceState.containsKey(KEY_FUTURE_MINUTES_LIMIT)) { mFutureMinutesLimit = savedInstanceState.getInt(KEY_FUTURE_MINUTES_LIMIT); } if (savedInstanceState.containsKey(KEY_PAST_MINUTES_LIMIT)) { mPastMinutesLimit = savedInstanceState.getInt(KEY_PAST_MINUTES_LIMIT); } if (savedInstanceState.containsKey(KEY_CURRENT_DATE)) { mValidateDateTime = (Calendar) savedInstanceState.getSerializable(KEY_CURRENT_DATE); } if (savedInstanceState.containsKey(KEY_PICKER_DATE)) { mPickerDate = (Calendar) savedInstanceState.getSerializable(KEY_PICKER_DATE); } } else { if (mIs24HourMode == null) { mIs24HourMode = DateFormat.is24HourFormat(getContext()); } } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); eventService = initializeService(); ListView lv = (ListView) findViewById(R.id.eventList); arrayAdapter = new EventListArrayAdapter(this, android.R.layout.simple_list_item_1, events); lv.setAdapter(arrayAdapter); lv.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { Event event = events.get(position); if (event.hasUrl()) { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(event.getUrl())); startActivity(myIntent); } } }); if (savedInstanceState != null) { Serializable eventsSerializable = savedInstanceState.getSerializable(EventsKey); Serializable preferenceSerializable = savedInstanceState.getSerializable(PreferenceKey); if (eventsSerializable != null && preferenceSerializable != null) { updateEvents((List<Event>) eventsSerializable, (Preference) preferenceSerializable); } } if (isEventLoadRequired()) { new LoadEventsTask().execute(); } }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); switch (getCurrentState(savedInstanceState)) { case FIRST_TIME_START: getLoaderManager().initLoader(DB_CACHE_LOADER_ID, null, dbCallback); break; case ACTIVITY_DESTROY_AND_CREATE: userBean = savedInstanceState.getParcelable(Constants.USERBEAN); accountBean = savedInstanceState.getParcelable(Constants.ACCOUNT); token = savedInstanceState.getString(Constants.TOKEN); timeLinePosition = (TimeLinePosition) savedInstanceState.getSerializable("timeLinePosition"); unreadBean = savedInstanceState.getParcelable("unreadBean"); Loader<CommentTimeLineData> loader = getLoaderManager().getLoader(DB_CACHE_LOADER_ID); if (loader != null) { getLoaderManager().initLoader(DB_CACHE_LOADER_ID, null, dbCallback); } CommentListBean savedBean = (CommentListBean) savedInstanceState.getSerializable(Constants.BEAN); if (savedBean != null && savedBean.getSize() > 0) { clearAndReplaceValue(savedBean); timeLineAdapter.notifyDataSetChanged(); // setListViewPositionFromPositionsCache(); } else { getLoaderManager().initLoader(DB_CACHE_LOADER_ID, null, dbCallback); } break; } }
@SuppressWarnings("unchecked") @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { prefs = PreferenceManager.getDefaultSharedPreferences(super.getActivity()); View vv = super.getLayoutInflater(savedInstanceState).inflate(R.layout.widget_quiz, null); this.container = container; course = (Course) getArguments().getSerializable(Course.TAG); activity = ((Activity) getArguments().getSerializable(Activity.TAG)); this.setIsBaseline(getArguments().getBoolean(CourseActivity.BASELINE_TAG)); quizContent = ((Activity) getArguments().getSerializable(Activity.TAG)) .getContents( prefs.getString(PrefsActivity.PREF_LANGUAGE, Locale.getDefault().getLanguage())); LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); vv.setLayoutParams(lp); vv.setId(activity.getActId()); if ((savedInstanceState != null) && (savedInstanceState.getSerializable("widget_config") != null)) { setWidgetConfig( (HashMap<String, Object>) savedInstanceState.getSerializable("widget_config")); } return vv; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // super.onCreateView(inflater, container, savedInstanceState); View rootView = inflater.inflate(R.layout.activity_produto, container, false); if (savedInstanceState == null || savedInstanceState.getSerializable(KEY) == null) { mProduto = (Produto) getSherlockActivity().getIntent().getSerializableExtra(EXTRA_PRODUTO); } else { mProduto = (Produto) savedInstanceState.getSerializable(KEY); } TextView productName = (TextView) rootView.findViewById(R.id.productName); TextView productLinha = (TextView) rootView.findViewById(R.id.productLinha); TextView productDescription = (TextView) rootView.findViewById(R.id.productDescription); TextView productPrice = (TextView) rootView.findViewById(R.id.productPrice); productName.setText(mProduto.getName()); productLinha.setText(mProduto.getmLinha().getName()); productDescription.setText(mProduto.getDescription()); productPrice.setText("R$" + new DecimalFormat("0.00").format(mProduto.getPrice()).toString()); getSherlockActivity().setTitle(mProduto.getEstabelecimento().getName()); return rootView; }
public void a(Bundle paramBundle) { int n = 0; if (paramBundle != null) { d.addAll((ArrayList)paramBundle.getSerializable("contact_details")); h = paramBundle.getInt("selector_dialog_title_id", 0); i = null; paramBundle = paramBundle.getBundle("selector_dialog_choices"); if (paramBundle != null) { i = new ArrayList(paramBundle.size()); while (n < paramBundle.size()) { i.add((fac)paramBundle.getSerializable(11 + n)); n += 1; } } if ((h > 0) && (i != null) && (i.size() > 1)) { paramBundle = l.a(m); bz localbz = l.a(); if (paramBundle != null) { localbz.a(paramBundle); } g = ((fab)ilh.a(e, fab.class)).a(e.getResources().getString(h), i); g.a(j); g.a(localbz, m); } } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_book_event, container); ButterKnife.bind(this, view); Bundle args = getArguments(); selectedRoom = args.getParcelable(Room.TAG); startDate = (Date) args.getSerializable(START_DATE); endDate = (Date) args.getSerializable(END_DATE); client = GoogleCalendarApiClient.getInstance(); mProgress = new ProgressDialog(getContext()); mProgress.setMessage(getResources().getString(R.string.loading_message)); getDialog().setTitle(selectedRoom.name); String summary = getResources() .getString(R.string.room_booking_title, sdf.format(startDate), sdf.format(endDate)); tvSummary.setText(summary); setupButtons(); setupEditText(); etSummary.requestFocus(); getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return view; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_display); if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { itemId = null; } else { itemId = extras.getString("itemId"); } } else { itemId = (String) savedInstanceState.getSerializable("itemId"); } if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { imageNum = 0; } else { imageNum = extras.getInt("imageNum"); } } else { imageNum = (int) savedInstanceState.getSerializable("imageNum"); } if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { userId = null; } else { userId = extras.getString("userId"); } } else { userId = (String) savedInstanceState.getSerializable("userId"); } ParseQuery<ParseObject> query = ParseQuery.getQuery("Item"); query.getInBackground( itemId, new GetCallback<ParseObject>() { public void done(ParseObject object, ParseException e) { if (e == null) { if (object.has("itemImage0")) { ImageView displayImage = (ImageView) findViewById(R.id.imageDisplay); ParseFile image = object.getParseFile("itemImage0"); try { byte[] imageData = image.getData(); Bitmap bitmap = BitmapFactory.decodeByteArray(imageData, 0, imageData.length); displayImage.setImageBitmap(bitmap); } catch (ParseException e1) { e1.printStackTrace(); } } } else { } } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setVolumeControlStream(AudioManager.STREAM_MUSIC); mDbHelper = new LoginDbAdapter(Login.this); mDbHelper.open(); Bundle extras = getIntent().getExtras(); if (extras.getSerializable(InternetMenu.LOGIN_KEY) != null) { mWaitDialog = new TimeoutProgressDialog(Login.this, "Logging out", TAG, true); @SuppressWarnings("unchecked") HashMap<String, String> lastSession = (HashMap<String, String>) extras.getSerializable(InternetMenu.LOGIN_KEY); mReturnSession = lastSession; mDbHelper.deleteLogin(InternetMenu.USER_ID_KEY); mDbHelper.deleteLogin(InternetMenu.SESSION_TOKEN_KEY); HashMap<String, String> sendList = new HashMap<String, String>(); sendList.put(InternetMenu.USER_ID_KEY, lastSession.get(InternetMenu.USER_ID_KEY)); sendList.put(InternetMenu.SESSION_TOKEN_KEY, lastSession.get(InternetMenu.SESSION_TOKEN_KEY)); new ConnectionManager(Login.this, InternetMenu.mLogoutURL, sendList); } else { showLoggedOutView(); } }
@Override public void onCreate(Bundle state) { super.onCreate(state); Bundle args = getArguments(); mAccount = (XboxLiveAccount) args.getParcelable("account"); mIconCursor = null; mPayload = null; mAdapter = null; mTitleId = -1; if (state != null) { try { mTitleId = state.getLong("titleId", -1); mPayload = (RecentPlayers) state.getSerializable("payload"); mIconCursor = (IconCursor2) state.getSerializable("icons"); } catch (Exception e) { mTitleId = -1; mPayload = null; mIconCursor = null; } } setHasOptionsMenu(true); }
@Override public void onActivityCreated(Bundle savedInstanceState) { if (savedInstanceState != null) { userBean = (UserBean) savedInstanceState.getSerializable("userBean"); accountBean = (AccountBean) savedInstanceState.getSerializable("account"); token = savedInstanceState.getString("token"); hashMap = (HashMap) savedInstanceState.getSerializable("hashmap"); selectedId = savedInstanceState.getString("selectedId"); clearAndReplaceValue((MessageListBean) savedInstanceState.getSerializable("bean")); timeLineAdapter.notifyDataSetChanged(); refreshLayout(bean); } else { if (dbTask == null || dbTask.getStatus() == MyAsyncTask.Status.FINISHED) { dbTask = new DBCacheTask(); dbTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR); } hashMap.put("0", new MessageListBean()); hashMap.put("1", new MessageListBean()); } super.onActivityCreated(savedInstanceState); groupTask = new GroupTask(); groupTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR); }
protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case 1: // add reminder if (resultCode == RESULT_OK) { Bundle res = data.getExtras(); Reminder reminder = (Reminder) res.getSerializable("reminder"); reminders.addReminder(reminder); // PersistencyManager.saveReminder(reminder); // cloudMem.addReminderToDB(reminder); } break; case 2: // modify reminder if (resultCode == RESULT_OK) { Bundle res = data.getExtras(); if (res.getBoolean("delete")) { Integer index = res.getInt("index"); reminders.removeReminder(index); break; } Reminder reminder = (Reminder) res.getSerializable("reminder"); Integer index = res.getInt("index"); reminders.modifyReminder(reminder, index); } break; } }
@Override public void restoreState(Parcelable state, ClassLoader loader) { Bundle in = (Bundle) state; mPendingAlbumLimiter = (Limiter) in.getSerializable("limiter_albums"); mPendingSongLimiter = (Limiter) in.getSerializable("limiter_songs"); mPendingFileLimiter = (Limiter) in.getSerializable("limiter_files"); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ui_add_guest_activity); sharedPreference = new SharedPreference(); if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { eventId = null; eventNameValue = null; eventDatetimeValue = null; eventVenueValue = null; } else { eventId = extras.getString("EventID"); eventNameValue = extras.getString("EventName"); eventDatetimeValue = extras.getString("EventDatetime"); eventVenueValue = extras.getString("EventVenue"); } } else { eventId = (String) savedInstanceState.getSerializable("EventID"); eventNameValue = (String) savedInstanceState.getSerializable("EventName"); eventDatetimeValue = (String) savedInstanceState.getSerializable("EventDatetime"); eventVenueValue = (String) savedInstanceState.getSerializable("EventVenue"); } event = new Event(); event.setId(Integer.parseInt(eventId)); event.setEventName(eventNameValue); event.setLocationName(eventVenueValue); setupViews(); setupHandlers(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { if (args.containsKey(Constants.ARG_ACCOUNT_ID)) { String accountId = args.getString(Constants.ARG_ACCOUNT_ID); pocket = checkNotNull(application.getAccount(accountId)); } if (args.containsKey(Constants.ARG_URI)) { try { processUri(args.getString(Constants.ARG_URI)); } catch (CoinURIParseException e) { // TODO handle more elegantly Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); ACRA.getErrorReporter().handleException(e); } } if (pocket == null) { List<WalletAccount> accounts = application.getAllAccounts(); if (accounts.size() > 0) pocket = accounts.get(0); if (pocket == null) { ACRA.getErrorReporter() .putCustomData("wallet-exists", application.getWallet() == null ? "no" : "yes"); Toast.makeText(getActivity(), R.string.no_such_pocket_error, Toast.LENGTH_LONG).show(); getActivity().finish(); return; } } checkNotNull(pocket, "No account selected"); } else { throw new RuntimeException("Must provide account ID or a payment URI"); } sendAmountType = pocket.getCoinType(); messageFactory = pocket.getCoinType().getMessagesFactory(); if (savedInstanceState != null) { address = (Address) savedInstanceState.getSerializable(STATE_ADDRESS); addressTypeCanChange = savedInstanceState.getBoolean(STATE_ADDRESS_CAN_CHANGE_TYPE); sendAmount = (Value) savedInstanceState.getSerializable(STATE_AMOUNT); sendAmountType = (CoinType) savedInstanceState.getSerializable(STATE_AMOUNT_TYPE); } updateBalance(); setHasOptionsMenu(true); mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer); String localSymbol = config.getExchangeCurrencyCode(); for (ExchangeRatesProvider.ExchangeRate rate : getRates(getActivity(), localSymbol)) { localRates.put(rate.currencyCodeId, rate.rate); } loaderManager.initLoader(ID_RATE_LOADER, null, rateLoaderCallbacks); loaderManager.initLoader(ID_RECEIVING_ADDRESS_LOADER, null, receivingAddressLoaderCallbacks); }
@Override protected void onRestoreInstanceState(Bundle savedInstanceState) { // TODO Auto-generated method stub orderFragment.setPrice((String[]) savedInstanceState.getSerializable("priceString")); orderFragment.setPrice_int((int[]) savedInstanceState.getSerializable("priceInt")); orderFragment.setAdapter(); super.onRestoreInstanceState(savedInstanceState); }
@SuppressWarnings("unchecked") protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle bundle = this.getIntent().getExtras(); this.uDTO = (UserDTO) bundle.getSerializable(UserDTO.USER_SERIALIZABLE); this.requisitionList = (ArrayList<ArticleDTO>) bundle.getSerializable(FrmStock.REQUSITION_LIST_SERIALIZABLE); this.initComponents(); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (theme.isDarkTheme) { view.setBackgroundColor(getResources().getColor(R.color.background_material_dark)); } else { view.setBackgroundColor(getResources().getColor(R.color.background_material_light)); } configToolBar((Toolbar) view.findViewById(R.id.toolBar)); Bundle args = getArguments(); RedditSort sort = (RedditSort) args.getSerializable(KEY_SORT); ImgurFilters.TimeSort topSort = (ImgurFilters.TimeSort) args.getSerializable(KEY_TOP_SORT); mSortRG.check(sort == RedditSort.TIME ? R.id.newestRB : R.id.topRB); mDateRangeContainer.setVisibility(sort == RedditSort.TOP ? View.VISIBLE : View.GONE); switch (topSort) { case DAY: mSeekBar.setProgress(0); mDay.setTypeface(null, Typeface.BOLD); mDay.setTextColor(getResources().getColor(theme.accentColor)); break; case WEEK: mSeekBar.setProgress(20); mWeek.setTypeface(null, Typeface.BOLD); mWeek.setTextColor(getResources().getColor(theme.accentColor)); break; case MONTH: mSeekBar.setProgress(40); mMonth.setTypeface(null, Typeface.BOLD); mMonth.setTextColor(getResources().getColor(theme.accentColor)); break; case YEAR: mSeekBar.setProgress(60); mYear.setTypeface(null, Typeface.BOLD); mYear.setTextColor(getResources().getColor(theme.accentColor)); break; case ALL: mSeekBar.setProgress(80); mAll.setTypeface(null, Typeface.BOLD); mAll.setTextColor(getResources().getColor(theme.accentColor)); break; } mSeekBar.setOnSeekBarChangeListener(this); mSortRG.setOnCheckedChangeListener(this); // I've never found fragment transaction animations to work properly, so we will animate the // view // when it is added to the fragment manager view.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.filter_appear)); }
@Override protected void onRestoreInstanceState(Bundle savedState) { super.onRestoreInstanceState(savedState); // restore the current data, for instance when changing the screen // orientation mDataset = (XYMultipleSeriesDataset) savedState.getSerializable("dataset"); mRenderer = (XYMultipleSeriesRenderer) savedState.getSerializable("renderer"); mCurrentSeries = (XYSeries) savedState.getSerializable("current_series"); mCurrentRenderer = (XYSeriesRenderer) savedState.getSerializable("current_renderer"); }
public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); username = savedInstanceState.getString(STATE_USERNAME); if (findViewById(R.id.maincontent) != null) { lastSelected = (Bookmark) savedInstanceState.getSerializable(STATE_LASTBOOKMARK); lastViewType = (BookmarkViewType) savedInstanceState.getSerializable(STATE_LASTVIEWTYPE); setBookmarkView(lastSelected, lastViewType); } }
public void loadState(Bundle bundle) { // enemyMap = (GameObjectMap<Enemy>) enemyMap = (MovementGameObjectMap<Enemy>) bundle.getSerializable("ENEMY_MAP"); tileMap = (GameObjectMap<Tile>) bundle.getSerializable("TILE_MAP"); shipMap = (MovementGameObjectMap<Ship>) bundle.getSerializable("SHIP_MAP"); mineMap = (GameObjectMap<Mine>) bundle.getSerializable("MINE_MAP"); mapMap = (HashMap<Class<? extends GameObject>, GameObjectMap<?>>) bundle.getSerializable("MAP_MAP"); mapWidth = bundle.getInt("MAP_WIDTH"); mapHeight = bundle.getInt("MAP_HEIGHT"); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null && args.containsKey(REFERENCE_KEY)) { mReference = args.getInt(REFERENCE_KEY); } if (args != null && args.containsKey(THEME_RES_ID_KEY)) { mTheme = args.getInt(THEME_RES_ID_KEY); } if (args != null && args.containsKey(PLUS_MINUS_VISIBILITY_KEY)) { mPlusMinusVisibility = args.getInt(PLUS_MINUS_VISIBILITY_KEY); } if (args != null && args.containsKey(DECIMAL_VISIBILITY_KEY)) { mDecimalVisibility = args.getInt(DECIMAL_VISIBILITY_KEY); } if (args != null && args.containsKey(MIN_NUMBER_KEY)) { mMinNumber = (BigDecimal) args.getSerializable(MIN_NUMBER_KEY); } if (args != null && args.containsKey(MAX_NUMBER_KEY)) { mMaxNumber = (BigDecimal) args.getSerializable(MAX_NUMBER_KEY); } if (args != null && args.containsKey(LABEL_TEXT_KEY)) { mLabelText = args.getString(LABEL_TEXT_KEY); } if (args != null && args.containsKey(CURRENT_NUMBER_KEY)) { mCurrentNumber = args.getInt(CURRENT_NUMBER_KEY); } if (args != null && args.containsKey(CURRENT_DECIMAL_KEY)) { mCurrentDecimal = args.getDouble(CURRENT_DECIMAL_KEY); } if (args != null && args.containsKey(CURRENT_SIGN_KEY)) { mCurrentSign = args.getInt(CURRENT_SIGN_KEY); } setStyle(DialogFragment.STYLE_NO_TITLE, 0); // Init defaults mTextColor = getResources().getColorStateList(R.color.dialog_text_color_holo_dark); mDialogBackgroundResId = R.drawable.dialog_full_holo_dark; if (mTheme != -1) { TypedArray a = getActivity() .getApplicationContext() .obtainStyledAttributes(mTheme, R.styleable.BetterPickersDialogFragment); mTextColor = a.getColorStateList(R.styleable.BetterPickersDialogFragment_bpTextColor); mDialogBackgroundResId = a.getResourceId( R.styleable.BetterPickersDialogFragment_bpDialogBackground, mDialogBackgroundResId); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle bundle = getArguments(); if (bundle != null) { mTeam = (Team) bundle.getSerializable(TeamMainActivity.BUNDLE_KEY_TEAM); mTeamProject = (TeamProject) bundle.getSerializable(TeamMainActivity.BUNDLE_KEY_PROJECT); mTeamId = mTeam.getId(); } }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ctx = getApplicationContext(); activity = this; setContentView(R.layout.camera); setFields(); mLocationRequest = LocationRequest.create(); mLocationRequest.setInterval(2000); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequest.setFastestInterval(1000); mLocationClient = new LocationClient(getApplicationContext(), this, this); // get objects if (savedInstanceState != null) { Log.e(LOG, "##### savedInstanceState is LOADED"); type = savedInstanceState.getInt("type", 0); projectSite = (ProjectSiteDTO) savedInstanceState.getSerializable("projectSite"); project = (ProjectDTO) savedInstanceState.getSerializable("project"); String path = savedInstanceState.getString("photoFile"); if (path != null) { photoFile = new File(path); } } else { type = getIntent().getIntExtra("type", 0); project = (ProjectDTO) getIntent().getSerializableExtra("project"); projectSite = (ProjectSiteDTO) getIntent().getSerializableExtra("projectSite"); projectSiteTask = (ProjectSiteTaskDTO) getIntent().getSerializableExtra("projectSiteTask"); companyStaff = (CompanyStaffDTO) getIntent().getSerializableExtra("companyStaff"); } Log.e(LOG, "###### type: " + type); if (savedInstanceState != null) { String path = savedInstanceState.getString("filePath"); if (path != null) { Log.w(LOG, "###### file path is: " + path); currentFullFile = new File(path); currentThumbFile = new File(savedInstanceState.getString("thumbPath")); try { Bitmap bm = ImageUtil.getBitmapFromUri(ctx, Uri.fromFile(currentFullFile)); image.setImageBitmap(bm); } catch (Exception e) { e.printStackTrace(); } } else { dispatchTakePictureIntent(); } } else { dispatchTakePictureIntent(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sistema_mac_elevacao_result); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); Bundle extras = getIntent().getExtras(); if (getIntent().hasExtra("resultados")) { resultados = (Resultado[]) extras.getSerializable("resultados"); } else { if (getIntent().hasExtra("consulta")) { Consulta consulta = (Consulta) extras.getSerializable("consulta"); ArrayList<Resultado> resultadosList = consulta.getListaResultados(); resultados = new Resultado[11]; if (resultadosList.size() == 8) { for (int i = 0; i < resultadosList.size(); i++) resultados[i] = resultadosList.get(i); } if (resultadosList.size() == 9) { Resultado resultadoTest = resultadosList.get(3); if (resultadosList .get(3) .getTitulo() .equals(getString(R.string.GamElevacaoConstrangimentTitulo))) { resultados[0] = resultadosList.get(0); resultados[1] = resultadosList.get(1); resultados[2] = resultadosList.get(2); resultados[4] = resultadosList.get(3); resultados[5] = resultadosList.get(4); resultados[6] = resultadosList.get(5); resultados[7] = resultadosList.get(6); resultados[8] = resultadosList.get(7); resultados[9] = resultadosList.get(8); } else { resultados[0] = resultadosList.get(0); resultados[1] = resultadosList.get(1); resultados[2] = resultadosList.get(2); resultados[3] = resultadosList.get(3); resultados[4] = resultadosList.get(4); resultados[5] = resultadosList.get(5); resultados[6] = resultadosList.get(6); resultados[7] = resultadosList.get(7); resultados[10] = resultadosList.get(8); } } } } mostrarCores(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); }
@Override public void onReceive(Context context, Intent intent) { if (intent == null) { return; } sheJiaoMao = (SheJiaoMaoApplication) context.getApplicationContext(); Bundle bundle = intent.getExtras(); account = (LocalAccount) bundle.getSerializable("ACCOUNT"); entity = (NotificationEntity) bundle.getSerializable("NOTIFICATION_ENTITY"); noticeNewBlog(context); if (Logger.isDebug()) Log.v(TAG, entity.toString()); }
@Override protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); Calendar cal = (Calendar) savedInstanceState.getSerializable("StartDate"); tStartDate.setTag(cal); tStartDate.setText(sdfdate.format(cal.getTime())); tStartTime.setTag(cal); tStartTime.setText(sdftime.format(cal.getTime())); cal = (Calendar) savedInstanceState.getSerializable("EndDate"); tEndDate.setTag(cal); tEndDate.setText(sdfdate.format(cal.getTime())); tEndTime.setTag(cal); tEndTime.setText(sdftime.format(cal.getTime())); }
public void retrieveContacts() { Bundle extras = this.getArguments(); customerDTO = (CustomerDTO) extras.getSerializable(SessionAttributes.CUSTOMER); RetrieveContactsTask retrieveContactsTask = new RetrieveContactsTask(); retrieveContactsTask.execute(); }