Example usage for android.os Bundle getLong

List of usage examples for android.os Bundle getLong

Introduction

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

Prototype

public long getLong(String key) 

Source Link

Document

Returns the value associated with the given key, or 0L if no mapping of the desired type exists for the given key.

Usage

From source file:com.piusvelte.cloudset.android.ConfirmDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        if (savedInstanceState.containsKey(EXTRA_DEVICE_ID)) {
            deviceId = savedInstanceState.getLong(EXTRA_DEVICE_ID);
        }/* w  w  w .  j av a  2 s .co  m*/
    }
    return new AlertDialog.Builder(getActivity()).setTitle(R.string.title_deregister)
            .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    DevicesListener listener;
                    try {
                        listener = (DevicesListener) getActivity();
                        listener.removeDevice(deviceId);
                    } catch (ClassCastException e) {
                        throw new ClassCastException(
                                getActivity().toString() + " must implement DevicesListener");
                    }
                }
            }).setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    // do nothing
                }
            }).create();
}

From source file:com.robwilliamson.healthyesther.fragment.dialog.AbstractAddNamedDialogFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    if (savedInstanceState != null && mSuggestions == null) {
        mSuggestions = Utils.Bundles.get(savedInstanceState, SUGGESTIONS, new Utils.Bundles.HashGetter<Long>() {
            @Override/*from   ww  w .  j a va 2  s  .c  o  m*/
            public Long get(Bundle bundle, String bundleKey) {
                long value = bundle.getLong(bundleKey);
                return value == 0L ? null : value;
            }
        });
    }
}

From source file:com.doctoror.fuckoffmusicplayer.presentation.library.DeleteItemDialogFragment.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Bundle args = getArguments();
    if (args == null) {
        throw new IllegalArgumentException("Arguments must contain EXTRA_ID");
    }/*from   w w w.  j a  v  a  2  s  .c o  m*/
    mId = args.getLong(EXTRA_ID);
    if (mId == 0) {
        throw new IllegalArgumentException("Arguments must contain non-zero EXTRA_ID");
    }
    mName = args.getString(EXTRA_NAME);
}

From source file:com.lkunic.lib.activityaddonlib.twopane.fragments.ItemDetailFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (savedInstanceState != null && savedInstanceState.containsKey(ARG_ITEM_ID)) {
        mItemId = savedInstanceState.getLong(ARG_ITEM_ID);
    }/*from   ww w  .  ja  v a 2  s . com*/
}

From source file:com.piusvelte.cloudset.android.Actions.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.actions);//from w  ww .j  ava 2s .c  o  m

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    Intent intent = getIntent();
    if (intent != null) {
        Bundle extras = intent.getExtras();
        if ((extras != null) && extras.containsKey(EXTRA_PUBLISHER) && extras.containsKey(EXTRA_SUBSCRIBER)) {
            publisherId = extras.getLong(EXTRA_PUBLISHER);
            subscriberId = extras.getLong(EXTRA_SUBSCRIBER);
        }
    }
}

From source file:de.vanita5.twittnuker.fragment.support.BaseActivitiesListFragment.java

protected final long[] getAccountIds() {
    final Bundle args = getArguments();
    if (args != null && args.containsKey(EXTRA_ACCOUNT_ID))
        return new long[] { args.getLong(EXTRA_ACCOUNT_ID) };
    return Utils.getActivatedAccountIds(getActivity());
}

From source file:com.glanznig.beepme.view.ViewSampleFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
    super.onCreate(savedState);

    View rootView = inflater.inflate(R.layout.view_sample, container, false);
    Bundle args = getArguments();
    sampleId = args.getLong("sampleId");

    return rootView;
}

From source file:com.LiteralWord.Bible.Notes.NoteEditFragment.java

public void onHandleIntent(Intent I) {
    getActivity().setIntent(I);/* www  . j a  v a 2s  . c  o m*/
    Bundle extras = I.getExtras();

    mRowId = extras == null ? null : extras.getLong(MyDbAdapter.KEY_ROWID);
    Log.d(LiteralWord.TAG, TAG + " New Intent, ID = " + mRowId);
    populateFields();
}

From source file:com.alchemiasoft.book.fragment.BookDetailFragment.java

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    switch (id) {
    case ID_LOADER_BOOK:
        return new CursorLoader(getActivity(), BookDB.Book.create(args.getLong(ARG_BOOK_ID)), null, null, null,
                null);//  w  w  w.j ava  2  s  .com
    default:
        throw new IllegalArgumentException("Id=" + id + " is not supported.");
    }
}

From source file:com.sourceallies.android.zonebeacon.fragment.BrightnessControlFragment.java

@Override
public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    Bundle args = getArguments();
    long gatewayId = args.getLong(ARG_GATEWAY_ID);
    boolean isZone = args.getBoolean(ARG_IS_ZONE);
    long itemId = args.getLong(ARG_ITEM_ID);

    DataSource source = DataSource.getInstance(getActivity());
    source.open();//from  ww  w  . j a va 2  s  .  co m

    gateway = source.findGateway(gatewayId);
    executor = Executor.createForGateway(gateway);
    commandTypes = source.findCommandTypesNotShownInUI(gateway);

    if (isZone) {
        List<Zone> zones = source.findZones(gateway);
        setZone(zones, itemId);
    } else {
        List<Button> buttons = source.findButtons(gateway);
        setButton(buttons, itemId);
    }

    source.close();
}