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, long defaultValue) 

Source Link

Document

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

Usage

From source file:com.freshdigitable.udonroad.TweetInputFragment.java

@Override
public void onStart() {
    super.onStart();
    statusCache.open();/*from  w  w w .j a  v  a2  s .  co  m*/
    configRequestWorker.open();
    appSettings.open();
    final Bundle arguments = getArguments();
    final @TweetType int tweetType = arguments.getInt("tweet_type");
    final long statusId = arguments.getLong("status_id", -1);
    stretchTweetInputView(tweetType, statusId);
}

From source file:com.hyperaware.conference.android.fragment.AgendaFragment.java

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LOGGER.fine("onCreate");
    restoreState(savedInstanceState);/*  ww  w  . ja  va 2 s.c  o m*/

    final Bundle args = getArguments();
    title = args.getString(ARG_TITLE);
    startAtTime = args.getLong(ARG_START_AT_TIME, 0);

    favSessionButtonManager = new FavSessionButtonManager(FirebaseDatabase.getInstance(),
            FirebaseAuth.getInstance(), new MyAuthRequiredListener());
}

From source file:com.github.jobs.ui.fragment.EditTemplateFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    // init argument fields
    Bundle arguments = getArguments();
    mTemplateId = arguments.getLong(ARG_TEMPLATE_ID, -1);

    mShowEditor = mShowEditor || mTemplateId == -1;

    // prepare ui
    View root = getView();/*w w w  .  ja v  a2 s .c o m*/
    mViewSwitcher = (ViewSwitcher) root.findViewById(R.id.switcher_edit_mode);
    if (!mShowEditor) {
        showEditor(mShowEditor);
    }

    WebView templatePreview = (WebView) root.findViewById(R.id.lbl_cover_letter_preview);
    AppUtils.setupWebView(templatePreview);
    mJavascriptInterface = new GithubJobsJavascriptInterface(getActivity(), templatePreview, null);
    templatePreview.addJavascriptInterface(mJavascriptInterface, JS_INTERFACE);
    templatePreview.loadUrl(PREVIEW_TEMPLATE_URL);

    mTemplateName = (EditText) root.findViewById(R.id.edit_cover_letter_name);
    mTemplateContent = (EditText) root.findViewById(R.id.edit_cover_letter_content);
    mTemplateContent.addTextChangedListener(mTextWatcher);

    if (mTemplateId != -1) {
        // retrieve template from database
        Template template = new Template();
        template.setId(mTemplateId);
        template = adapter.findFirst(template);
        ArrayList<TemplateService> templateServices = new ArrayList<TemplateService>(
                template.getTemplateServices());
        for (TemplateService savedService : mTemplateServices) {
            if (!templateServices.contains(savedService)) {
                templateServices.add(savedService);
            }
        }
        mTemplateServices = templateServices;

        // set name and raw content
        mTemplateName.setText(template.getName());
        getActivity().setTitle(template.getName());
        String content = template.getContent();
        mTemplateContent.setText(content);
        updatePreview();
    }
}

From source file:com.cl.slack.gesture.GestureBuilderActivity.java

@Override
protected void onRestoreInstanceState(Bundle state) {
    super.onRestoreInstanceState(state);

    long id = state.getLong(GESTURES_INFO_ID, -1);
    if (id != -1) {
        final Set<String> entries = sStore.getGestureEntries();
        out: for (String name : entries) {
            for (Gesture gesture : sStore.getGestures(name)) {
                if (gesture.getID() == id) {
                    mCurrentRenameGesture = new NamedGesture();
                    mCurrentRenameGesture.name = name;
                    mCurrentRenameGesture.gesture = gesture;
                    break out;
                }/*from w  w w.  j a v  a 2  s  .c o  m*/
            }
        }
    }
}

From source file:edu.mit.media.funf.configured.ConfiguredPipeline.java

public void onDataReceived(Bundle data) {
    String dataJson = getBundleSerializer().serialize(data);
    String probeName = data.getString(Probe.PROBE);
    long timestamp = data.getLong(Probe.TIMESTAMP, 0L);
    Bundle b = new Bundle();
    b.putString(NameValueDatabaseService.DATABASE_NAME_KEY, getPipelineName());
    b.putLong(NameValueDatabaseService.TIMESTAMP_KEY, timestamp);
    b.putString(NameValueDatabaseService.NAME_KEY, probeName);
    b.putString(NameValueDatabaseService.VALUE_KEY, dataJson);
    Intent i = new Intent(this, getDatabaseServiceClass());
    i.setAction(DatabaseService.ACTION_RECORD);
    i.putExtras(b);//from w  ww .  j  av a 2  s  .c  om
    startService(i);
}

From source file:com.appsimobile.appsii.hotspotmanager.HotspotSettingsFragment.java

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

    Bundle args = getArguments();
    if (args == null) {
        mHotspotId = -1L;//from www .  j  a  va  2s.c  om
    } else {
        // get the default values from the arguments
        mHotspotId = args.getLong("hotspot_id", -1L);
        mHotspotName = args.getString("hotspot_name");
        mDefaultPageId = args.getLong("default_page_id");
    }
    // track if the state was restored
    if (savedInstanceState != null) {
        mRestoredInstanceState = true;
        mDefaultPageId = savedInstanceState.getLong("default_page_id");
    }

    mQueryHandler = new QueryHandlerImpl(getActivity().getContentResolver());
    mReorderController = new ReorderController(getActivity(), mHotspotId);

    getLoaderManager().initLoader(1, null, new HotspotPagesLoaderCallbacks());
}

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

@Override
public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
    final long accountId = args != null ? args.getLong(EXTRA_ACCOUNT_ID, -1) : -1;
    final long recipientId = args != null ? args.getLong(EXTRA_RECIPIENT_ID, -1) : -1;
    final String[] cols = DirectMessages.COLUMNS;
    final boolean isValid = accountId > 0 && recipientId > 0;
    mConversationContainer.setVisibility(isValid ? View.VISIBLE : View.GONE);
    mRecipientSelectorContainer.setVisibility(isValid ? View.GONE : View.VISIBLE);
    if (!isValid)
        return new CursorLoader(getActivity(), TweetStore.CONTENT_URI_NULL, cols, null, null, null);
    final Uri uri = buildDirectMessageConversationUri(accountId, recipientId, null);
    return new CursorLoader(getActivity(), uri, cols, null, null, Conversation.DEFAULT_SORT_ORDER);
}

From source file:com.grokkingandroid.sampleapp.samples.data.contentprovider.lentitems.LentItemFormFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        mItemId = getArguments().getLong(KEY_ITEM_ID, -1);
    }//from w  ww.  j a va  2  s .c  om
    if (savedInstanceState != null) {
        if (savedInstanceState.containsKey(KEY_ITEM_ID)) {
            mItemId = savedInstanceState.getLong(KEY_ITEM_ID, mItemId);
        }
        if (savedInstanceState.containsKey(KEY_PHOTO_URI)) {
            mPhotoUri = Uri.parse(savedInstanceState.getString(KEY_PHOTO_URI));
        }
        mWasActivityForResultStarted = savedInstanceState.getBoolean(KEY_ACTIVITY_FOR_RESULT_STARTED, false);
    }
    setHasOptionsMenu(true);
}

From source file:com.mikifus.padland.PadListActivity.java

private void _detectItemFocus() {
    Bundle extras = getIntent().getExtras();
    if (extras == null) {
        return;//  w  w w .j  a  v  a2 s. c om
    }
    long pad_id = extras.getLong(INTENT_FOCUS_PAD, 0);
    if (pad_id > 0) {
        //            Bundle position = adapter.getPosition(pad_id);
        //            expandableListView.smoothScrollToPosition(position.getInt("groupPosition"), position.getInt("childPosition"));
        //            expandableListView.setSelectedChild(position.getInt("groupPosition"), position.getInt("childPosition"), true);

    }
}

From source file:com.xengar.android.englishverbs.ui.EditorActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_editor);

    // Examine the intent that was used to launch this activity,
    // in order to figure out if we're creating a new verb or editing an existing one.
    //Intent intent = getIntent();
    //mCurrentVerbUri = intent.getData();
    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {
        verbID = bundle.getLong(VERB_ID, -1);
    }//from  w ww. j a  v a  2  s . c  o  m

    // If the intent DOES NOT contain a verb content URI, then we know that we are
    // creating a new verb.
    if (verbID == -1) {
        setTitle(getString(R.string.action_add_verb));

        // Invalidate the options menu, so the "Delete" menu option can be hidden.
        invalidateOptionsMenu();
        calculateUserVerbID();
    } else {
        setTitle(getString(R.string.action_edit_verb));

        // Initialize a loader to read the verb data from the database
        // and display the current values in the editor
        getLoaderManager().initLoader(VERB, null, this);
    }

    // Find all relevant views that we will need to read user input from
    mInfinitive = (EditText) findViewById(R.id.edit_infinitive);
    mSimplePast = (EditText) findViewById(R.id.edit_simple_past);
    mPastParticiple = (EditText) findViewById(R.id.edit_past_participle);
    mRegularSpinner = (Spinner) findViewById(R.id.spinner_regular);
    mDefinition = (EditText) findViewById(R.id.edit_definition);
    mSample1 = (EditText) findViewById(R.id.edit_sample1);
    mSample2 = (EditText) findViewById(R.id.edit_sample2);
    mSample3 = (EditText) findViewById(R.id.edit_sample3);

    // Setup OnTouchListeners on all the input fields, so we can determine if the user
    // has touched or modified them. This will let us know if there are unsaved changes
    // or not, if the user tries to leave the editor without saving.
    mInfinitive.setOnTouchListener(mTouchListener);
    mInfinitive.setOnTouchListener(mTouchListener);
    mPastParticiple.setOnTouchListener(mTouchListener);
    mRegularSpinner.setOnTouchListener(mTouchListener);
    mDefinition.setOnTouchListener(mTouchListener);
    mSample1.setOnTouchListener(mTouchListener);
    mSample2.setOnTouchListener(mTouchListener);
    mSample3.setOnTouchListener(mTouchListener);

    setupSpinner();

    // Obtain the FirebaseAnalytics instance.
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    ActivityUtils.firebaseAnalyticsLogEventSelectContent(mFirebaseAnalytics, PAGE_EDITOR, PAGE_EDITOR,
            TYPE_PAGE);
}