List of usage examples for android.os Bundle putLong
public void putLong(@Nullable String key, long value)
From source file:love.juhe.androidmonkey.MonkeyActivityEvent.java
@SuppressLint("NewApi") @Override/* ww w.jav a2s .c o m*/ public int fireEvent(Instrumentation testRuner) { Intent intent = getEvent(); MonkeyLog.l(":Switch: " + intent.toUri(0)); if (mAlarmTime != 0) { Bundle args = new Bundle(); args.putLong("alarmTime", mAlarmTime); intent.putExtras(args); } try { // IntentFilter filter = new IntentFilter(getEvent().getAction()); // ActivityMonitor monitor = testRuner.addMonitor(filter, null, true); testRuner.startActivitySync(intent); // testRuner.waitForMonitorWithTimeout(monitor, 10); } catch (SecurityException e) { MonkeyLog.l("** Permissions error starting activity " + intent.toUri(0)); return MonkeyEvent.INJECT_ERROR_SECURITY_EXCEPTION; } return MonkeyEvent.INJECT_SUCCESS; }
From source file:com.lkunic.lib.activityaddonlib.twopane.fragments.ItemDetailFragment.java
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong(ARG_ITEM_ID, mItemId); }
From source file:ca.rmen.android.scrumchatter.meeting.Meetings.java
/** * Shows a confirmation dialog to delete the given meeting. *//*from w w w . ja v a 2 s . co m*/ public void confirmDelete(final Meeting meeting) { Log.v(TAG, "confirm delete meeting: " + meeting); // Let's ask him if he's sure first. Bundle extras = new Bundle(1); extras.putLong(EXTRA_MEETING_ID, meeting.getId()); DialogFragmentFactory.showConfirmDialog(mActivity, mActivity.getString(R.string.action_delete_meeting), mActivity.getString(R.string.dialog_message_delete_meeting_confirm, TextUtils.formatDateTime(mActivity, meeting.getStartDate())), R.id.action_delete_meeting, extras); }
From source file:ca.rmen.android.palidamuerte.app.poem.detail.PoemPagerAdapter.java
@Override public Fragment getItem(int position) { Log.v(TAG, "getItem at position " + position); PoemDetailFragment fragment = new PoemDetailFragment(); Bundle args = new Bundle(1); mCursor.moveToPosition(position);// www .jav a 2s . c o m args.putLong(PoemDetailFragment.ARG_ITEM_ID, mCursor.getId()); fragment.setArguments(args); return fragment; }
From source file:com.glanznig.beepme.view.ViewSampleActivity.java
@Override public void onSaveInstanceState(Bundle savedState) { savedState.putLong("sampleId", sampleId); }
From source file:com.nextgis.maplibui.formcontrol.Counter.java
@Override public void saveState(Bundle outState) { super.saveState(outState); outState.putLong(ControlHelper.getSavedStateKey(mFieldName), mIncremented); }
From source file:com.roque.rueda.cashflows.MovementsActivity.java
/** * Method called when the activity is created for the first time, * initialize this activity.//www .j ava 2 s . c o m * * @param savedInstanceState Saved state of the application. */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_movements); // Show the Up button in the action bar. getActionBar().setDisplayHomeAsUpEnabled(true); // 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. if (savedInstanceState == null) { // Create the detail fragment and add it to the activity // using a fragment transaction. // Get the account id. long accountId = getIntent().getLongExtra(MovementsListFragment.ARG_ACCOUNT_ID, 1); // 1 is the default value. Bundle arguments = new Bundle(); arguments.putLong(MovementsListFragment.ARG_ACCOUNT_ID, accountId); MovementsListFragment fragment = new MovementsListFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().add(R.id.movements_container, fragment).commit(); } }
From source file:com.creationgroundmedia.popularmovies.MovieDetailActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_movie_detail); Toolbar toolbar = (Toolbar) findViewById(R.id.detail_toolbar); setSupportActionBar(toolbar);// ww w .jav a2s . com // Show the Up button in the action bar. ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } // 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.putLong(MoviesContract.MovieEntry.COLUMN_ID_KEY, getIntent().getLongExtra(MoviesContract.MovieEntry.COLUMN_ID_KEY, 0)); MovieDetailFragment fragment = new MovieDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().add(R.id.movie_detail_container, fragment).commit(); } }
From source file:com.pdftron.pdf.controls.UserBookmarkDialogFragment.java
public static UserBookmarkDialogFragment newInstance(String filePath, int currentPage, long currentObjNum) { UserBookmarkDialogFragment f = new UserBookmarkDialogFragment(); Bundle args = new Bundle(); args.putString(CURRENT_FILE_PATH, filePath); args.putInt(CURRENT_PAGE_NUMBER, currentPage); args.putLong(CURRENT_PAGE_OBJNUM, currentObjNum); args.putBoolean(CURRENT_FILE_READONLY, true); f.setArguments(args);/*from ww w.j a v a2 s .c om*/ return f; }
From source file:com.pdftron.pdf.controls.UserBookmarkDialogFragment.java
public static UserBookmarkDialogFragment newInstance(String filePath, int currentPage, long currentObjNum, boolean readOnly) { UserBookmarkDialogFragment f = new UserBookmarkDialogFragment(); Bundle args = new Bundle(); args.putString(CURRENT_FILE_PATH, filePath); args.putInt(CURRENT_PAGE_NUMBER, currentPage); args.putLong(CURRENT_PAGE_OBJNUM, currentObjNum); args.putBoolean(CURRENT_FILE_READONLY, readOnly); f.setArguments(args);/* w w w . ja v a 2 s. c o m*/ return f; }