List of usage examples for android.os Bundle putLong
public void putLong(@Nullable String key, long value)
From source file:com.enadein.carlogbook.core.CarLogbookMediator.java
public void showViewCar(long id) { Bundle params = new Bundle(); params.putInt(BaseActivity.MODE_KEY, AddUpdateCarActivity.PARAM_EDIT); params.putLong(BaseActivity.ENTITY_ID, id); startActivity(AddUpdateCarActivity.class, params); }
From source file:com.github.kanata3249.ffxieq.android.AugmentEditActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt("Part", mPart); outState.putLong("BaseId", mBaseID); outState.putLong("AugId", mAugID); }
From source file:com.dwdesign.tweetings.fragment.ConversationFragment.java
public void linkGenerationComplete(String url) { if (isShare == false) { final Intent intent = new Intent(INTENT_ACTION_COMPOSE); final Bundle bundle = new Bundle(); bundle.putLong(INTENT_KEY_ACCOUNT_ID, account_id); bundle.putString(INTENT_KEY_TEXT, url); intent.putExtras(bundle);/*from www. j a v a2s. co m*/ startActivity(intent); } else { final Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, url); startActivity(Intent.createChooser(intent, getString(R.string.share))); } }
From source file:com.example.nitish.welcomapp.activitypt.ElementListFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(KEY_SORT, mSort);/* ww w . j a v a 2s . c o m*/ outState.putBoolean(KEY_SORT_REVERSE, mSortReverse); outState.putString(KEY_FILTER, mFilter); outState.putLong(KEY_ACTIVATED_ITEM, mActivatedItem); }
From source file:com.project.richard.insightjournal.ui.timerscreen.TimerFragment.java
@Override public void onSaveInstanceState(Bundle outState) { outState.putBoolean(BOOLEAN_TIMER_RUNNING, mTimerRunning); outState.putLong(LONG_TIMER_DURATION, mTimerService.getDuration()); super.onSaveInstanceState(outState); }
From source file:com.narkii.security.info.LicenseInfoFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onActivityCreated(savedInstanceState); fileButton = (Button) view.findViewById(R.id.button_add_local); captureButton = (Button) view.findViewById(R.id.button_add_capture); uploadButton = (Button) view.findViewById(R.id.button_upload); previewImage = (ImageView) view.findViewById(R.id.image_preview); gridView = (GridView) view.findViewById(R.id.image_uploaded); fileName = (EditText) view.findViewById(R.id.text_file_name); gridViewAdapter = new GridViewAdapter(getActivity(), null, false); gridView.setAdapter(gridViewAdapter); captureButton.setOnClickListener(new OnClickListener() { @Override//www .ja v a 2 s . com public void onClick(View v) { // TODO Auto-generated method stub Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = MediaFileStorage.getOutputMediaFileUri(MediaFileStorage.MEDIA_TYPE_IMAGE); Log.d(TAG, fileUri.toString()); Log.d(TAG, fileUri.getPath()); i.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); getParentFragment().startActivityForResult(i, Constants.CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE); } }); fileButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(); intent.setType("*/*"); //("image/*") intent.setAction(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE); //FragmentFragmentFragmentFragmentResultFragment getParentFragment().startActivityForResult(intent, Constants.CONTENT_GET_ACTIVITY_REQUEST_CODE); } }); uploadButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if (preBitmap != null && !fileName.getText().toString().equals("")) { // new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub DbOperations operations = DbOperations.getInstance(getActivity()); ContentValues values = new ContentValues(); values.put(Permission.COLUMN_FK_ENTERPRISE_ID, getArguments().getLong("enterpriseId", 0)); Log.d(TAG, "storage file:" + fileUri.toString()); Log.d(TAG, "storage file:" + fileUri.getPath()); values.put(Permission.COLUMN_URL, fileUri.toString()); values.put(Permission.COLUMN_CERTIFICATE_NAME, fileName.getText().toString()); if (isImage) values.put(Permission.COLUMN_TYPE, 1); else values.put(Permission.COLUMN_TYPE, 2); long result = operations.insert(Permission.TABLE_NAME, values); if (result > 0) { Message msg = new Message(); msg.what = Constants.INSERT_UPLOADED_OK_MSG; handler.sendMessage(msg); } } }).start(); } else { Toast.makeText(getActivity(), "please select file and input name", Toast.LENGTH_LONG).show(); } } }); long id = getArguments().getLong("enterpriseId", 0); Bundle bundle = new Bundle(); bundle.putLong("id", id); getLoaderManager().initLoader(Constants.PERMISSION_IMAGE_ID, bundle, this); }
From source file:com.example.android.bitmapfun.ui.SearchStreamGridFragment.java
@TargetApi(16) @Override/*from w ww .ja va2s. com*/ public void onItemClick(AdapterView<?> parent, View v, int position, long id) { final Intent i = new Intent(getActivity(), StreamImageGridActivity.class); //ImageAdapter ad = (ImageAdapter) parent.getAdapter(); //int cols = ad.getNumColumns(); int cols = mAdapter.getNumColumns(); if (BuildConfig.DEBUG) { Log.d("Connexus", Long.toString(id)); Log.d("Connexus", String.valueOf(position)); Log.d("Connexus", String.valueOf(cols)); Log.d("Connexus", Long.toString(streamList.get(position - cols).id)); Log.d("Connexus", streamList.get(position - cols).name); } Bundle b = new Bundle(); b.putLong(StreamImageGridActivity.EXTRA_STREAM_DATA_STREAM_ID, streamList.get(position - cols).id); b.putString(StreamImageGridActivity.EXTRA_STREAM_DATA_STREAM_NAME, streamList.get(position - cols).name); i.putExtra(StreamImageGridActivity.EXTRA_IMAGE_DATA_URL, b); //i.putExtra(StreamImageGridActivity.EXTRA_IMAGE_DATA_URL, (position - cols)); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:com.dahl.brendan.wordsearch.view.controller.WordSearchActivityController.java
public void saveState(Bundle outState) { if (outState != null) { this.timePause(); outState.putLong(BUNDLE_TIME, this.timeSum); outState.putParcelable(BUNDLE_GRID, this.grid); if (this.hs != null) { outState.putBundle(BUNDLE_HIGH_SCORE, this.hs.toBundle()); }// w w w . j ava 2s . c o m } }
From source file:com.piusvelte.cloudset.android.CloudSetMain.java
@Override public void removeDevice(Long id) { if (id != null && !INVALID_DEVICE_ID.equals(deviceId)) { Bundle extras = new Bundle(); extras.putLong(EXTRA_DEREGISTER_ID, id); getSupportLoaderManager().initLoader(getNextLoaderId(), extras, this); }// w w w. jav a 2s.c om }
From source file:com.hichinaschool.flashcards.anki.StudyOptionsFragment.java
public static StudyOptionsFragment newInstance(long deckId, boolean onlyFnsMsg, Bundle cramInitialConfig) { StudyOptionsFragment f = new StudyOptionsFragment(); // Supply index input as an argument. Bundle args = new Bundle(); args.putLong("deckId", deckId); args.putBoolean("onlyFnsMsg", onlyFnsMsg); args.putBundle("cramInitialConfig", cramInitialConfig); f.setArguments(args);/* w w w.ja va 2 s . c o m*/ return f; }