Example usage for android.os Bundle putLong

List of usage examples for android.os Bundle putLong

Introduction

In this page you can find the example usage for android.os Bundle putLong.

Prototype

public void putLong(@Nullable String key, long value) 

Source Link

Document

Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.andremion.louvre.data.MediaLoader.java

public void loadByBucket(@IntRange(from = 0) long bucketId) {
    ensureActivityAttached();//from ww  w.j  av a 2 s. co  m
    if (ALL_MEDIA_BUCKET_ID == bucketId) {
        mActivity.getSupportLoaderManager().restartLoader(TIME_LOADER, null, this);
    } else {
        Bundle args = new Bundle();
        args.putLong(BUCKET_ID, bucketId);
        mActivity.getSupportLoaderManager().restartLoader(MEDIA_LOADER, args, this);
    }
}

From source file:ca.rmen.android.palidamuerte.app.poem.list.PoemListActivity.java

/**
 * Callback method from {@link PoemListFragment.Callbacks} indicating that the item with the given ID was selected.
 *//*from  w  w w . ja  v a 2 s.  c o m*/
@Override
public void onItemSelected(long id) {
    Log.v(TAG, "onItemSelected: id = " + id);
    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.putLong(PoemDetailFragment.ARG_ITEM_ID, id);
        PoemDetailFragment fragment = new PoemDetailFragment();
        fragment.setArguments(arguments);
        getSupportFragmentManager().beginTransaction().replace(R.id.poem_detail_container, fragment).commit();
        boolean refreshMenu = mPoemId < 0;
        mPoemId = id;
        if (mShareActionProvider != null)
            Poems.updateShareIntent(mShareActionProvider, this, mPoemId);
        if (refreshMenu)
            invalidateOptionsMenu();

    } else {
        // In single-pane mode, simply start the detail activity
        // for the selected item ID.
        Intent detailIntent = new Intent(this, PoemDetailActivity.class);
        detailIntent.setAction(getIntent().getAction());
        detailIntent.putExtra(SearchManager.QUERY, getIntent().getStringExtra(SearchManager.QUERY));
        detailIntent.putExtra(PoemDetailFragment.ARG_ITEM_ID, id);
        detailIntent.putExtra(EXTRA_CATEGORY_ID, getIntent().getLongExtra(EXTRA_CATEGORY_ID, -1));
        startActivity(detailIntent);
    }
}

From source file:com.dwdesign.tweetings.fragment.UserListMembersFragment.java

@Override
public void onSaveInstanceState(final Bundle outState) {
    outState.putLong(INTENT_KEY_PAGE, mCursor);
    super.onSaveInstanceState(outState);
}

From source file:ca.rmen.android.scrumchatter.member.list.Members.java

/**
 * Show a dialog with a text input for the new member name. Validate that the member doesn't already exist in the given team. Upon pressing "OK", create the
 * member.//from  w  ww .  j ava2 s .com
 * 
 * @param teamId the id of the team in which the member should be added
 */
void promptCreateMember(final int teamId) {
    Log.v(TAG, "createMember, teamId = " + teamId);
    Bundle extras = new Bundle(1);
    extras.putLong(Teams.EXTRA_TEAM_ID, teamId);
    DialogFragmentFactory.showInputDialog(mActivity, mActivity.getString(R.string.action_new_member),
            mActivity.getString(R.string.hint_new_member), null, MemberNameValidator.class, R.id.fab_new_member,
            extras);
}

From source file:com.app_software.chromisstock.ProductDetailActivity.java

private void createFragments() {
    Long productID = getIntent().getLongExtra(ProductDetailFragment.ARG_ITEM_ID, 0);

    // Create the detail fragment and add it to the activity
    Bundle detailArgs = new Bundle();
    detailArgs.putLong(ProductDetailFragment.ARG_ITEM_ID, productID);

    ProductDetailFragment newDetail = new ProductDetailFragment();
    newDetail.setArguments(detailArgs);/* w  w  w  .  j av  a  2  s . c  o m*/

    if (findViewById(R.id.product_detail_container) != null) {
        getSupportFragmentManager().beginTransaction().replace(R.id.product_detail_container, newDetail)
                .commit();
    } else {
        getSupportFragmentManager().beginTransaction().add(R.id.product_detail_container, newDetail).commit();
    }

    // Create the changes fragment and add it using a fragment transaction.
    DatabaseHandler db = DatabaseHandler.getInstance(this);

    Bundle changeArgs = new Bundle();
    StockProduct product = db.getProduct(productID, false);
    if (product == null) {
        Log.e(TAG, "Invalid Product ID");
        return;
    }

    String id = product.getChromisId();

    changeArgs.putString(ChangesFragment.ARG_PRODUCT, id);
    ChangesFragment newChanges = new ChangesFragment();
    newChanges.setArguments(changeArgs);

    if (findViewById(R.id.product_changes_container) != null) {
        getSupportFragmentManager().beginTransaction().replace(R.id.product_changes_container, newChanges)
                .commit();
    } else {
        getSupportFragmentManager().beginTransaction().add(R.id.product_changes_container, newChanges).commit();
    }
}

From source file:ca.rmen.android.scrumchatter.member.list.Members.java

/**
 * Shows a confirmation dialog to the user, to delete a member.
 *//*from   ww  w.  j  a v a  2  s. c  o  m*/
void confirmDeleteMember(final Member member) {
    Log.v(TAG, "confirm delete member " + member);
    // Let's ask him if he's sure.
    Bundle extras = new Bundle(1);
    extras.putLong(EXTRA_MEMBER_ID, member.id);
    DialogFragmentFactory.showConfirmDialog(mActivity, mActivity.getString(R.string.action_delete_member),
            mActivity.getString(R.string.dialog_message_delete_member_confirm, member.name),
            R.id.action_delete_member, extras);
}

From source file:ca.rmen.android.scrumchatter.member.list.Members.java

/**
 * Show a dialog with a text input for the member name. Validate that the member doesn't already exist in the given team. Upon pressing "OK", update the
 * name of the member./* www. ja  v a  2  s. c  o  m*/
 *
 * @param teamId the id of the member's team
 * @param member the team member to rename
 */
void promptRenameMember(final long teamId, final Member member) {
    Log.v(TAG, "promptRenameMember, teamId = " + teamId + ", member = " + member);
    Bundle extras = new Bundle(1);
    extras.putLong(Teams.EXTRA_TEAM_ID, teamId);
    extras.putLong(EXTRA_MEMBER_ID, member.id);
    extras.putString(EXTRA_MEMBER_NAME, member.name);
    DialogFragmentFactory.showInputDialog(mActivity, mActivity.getString(R.string.action_rename_member),
            mActivity.getString(R.string.hint_new_member), member.name, MemberNameValidator.class,
            R.id.action_rename_member, extras);
}

From source file:com.dabay6.android.apps.carlog.ui.base.BaseNavigationVehicleSelectorActivity.java

/**
 * {@inheritDoc}/*ww  w  . j a  va2  s.  co  m*/
 */
@Override
protected void onSaveInstanceState(final Bundle outState) {
    outState.putLong(KEY_VEHICLE_ID, vehicleId == null ? -1 : vehicleId);

    super.onSaveInstanceState(outState);
}

From source file:dk.dtu.imm.datacollector.MainPipeline.java

public void runProbeOnceNow(final String probeName) {
    FunfConfig config = getMainConfig(this);
    ArrayList<Bundle> updatedRequests = new ArrayList<Bundle>();
    Bundle[] existingRequests = config.getDataRequests(probeName);
    if (existingRequests != null) {
        for (Bundle existingRequest : existingRequests) {
            updatedRequests.add(existingRequest);
        }// ww  w. j av a2s .c  o m
    }

    Bundle oneTimeRequest = new Bundle();
    oneTimeRequest.putLong(Probe.Parameter.Builtin.PERIOD.name, 0L);
    updatedRequests.add(oneTimeRequest);

    Intent request = new Intent(Probe.ACTION_REQUEST);
    request.setClassName(this, probeName);
    request.putExtra(Probe.CALLBACK_KEY, getCallback());
    request.putExtra(Probe.REQUESTS_KEY, updatedRequests);
    startService(request);
}

From source file:ca.rmen.android.scrumchatter.meeting.detail.MeetingPagerAdapter.java

@Override
public Fragment getItem(int position) {
    Log.v(TAG, "getItem at position " + position);
    MeetingFragment fragment = new MeetingFragment();
    Bundle args = new Bundle(1);
    mCursor.moveToPosition(position);//from w ww.  j a v  a2s  . c o m
    args.putLong(Meetings.EXTRA_MEETING_ID, mCursor.getId());
    args.putSerializable(Meetings.EXTRA_MEETING_STATE, mCursor.getState());
    fragment.setArguments(args);
    return fragment;
}