Example usage for android.os Bundle putFloat

List of usage examples for android.os Bundle putFloat

Introduction

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

Prototype

@Override
public void putFloat(@Nullable String key, float value) 

Source Link

Document

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

Usage

From source file:info.guardianproject.notepadbot.NoteEdit.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    saveState();/*from w  w w  . ja va2  s.c  om*/

    if (mRowId != -1)
        outState.putLong(NotesDbAdapter.KEY_ROWID, mRowId);

    if (mTextSize != 0)
        outState.putFloat(TEXT_SIZE, mTextSize);
}

From source file:com.openlocationcode.android.main.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle savedInstanceState) {
    CameraPosition currentMapCameraPosition = mMainPresenter.getMapCameraPosition();
    Log.i(TAG, "Saving state");
    if (currentMapCameraPosition != null) {
        savedInstanceState.putDouble(MAP_CAMERA_POSITION_LATITUDE, currentMapCameraPosition.target.latitude);
        savedInstanceState.putDouble(MAP_CAMERA_POSITION_LONGITUDE, currentMapCameraPosition.target.longitude);
        savedInstanceState.putFloat(MAP_CAMERA_POSITION_ZOOM, currentMapCameraPosition.zoom);
    }/*from  w ww  . j a v a 2s. com*/

    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.odoo.addons.sale.SalesDetail.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.layoutAddItem:
        if (mForm.getValues() != null) {
            Intent intent = new Intent(this, AddProductLineWizard.class);
            Bundle extra = new Bundle();
            for (String key : lineValues.keySet()) {
                extra.putFloat(key, lineValues.get(key));
            }//w  w w. j  ava 2s . c  o m
            intent.putExtras(extra);
            startActivityForResult(intent, REQUEST_ADD_ITEMS);
        }
        break;
    }
}

From source file:com.appdynamics.demo.gasp.activity.LocationsActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    // Save incremental search results, page_token and zoom level
    outState.putSerializable(SEARCH_RESULT, mSearchResult);
    outState.putString(PAGE_TOKEN, mPageToken);
    outState.putFloat(ZOOM_LEVEL, mMap.getCameraPosition().zoom);
}

From source file:nz.ac.auckland.lablet.script.components.CameraExperiment.java

@Override
protected Bundle getExperimentOptions() {
    Bundle options = super.getExperimentOptions();

    // requested resolution
    int requestedWidth = cameraComponent.getRequestedVideoWidth();
    int requestedHeight = cameraComponent.getRequestedVideoHeight();
    if (requestedWidth > 0 && requestedHeight > 0) {
        options.putInt("requested_video_width", requestedWidth);
        options.putInt("requested_video_height", requestedHeight);
    }//from   www  .  j a v  a 2s.co m

    float recordingFrameRate = cameraComponent.getRecordingFrameRate();
    if (recordingFrameRate > 0)
        options.putFloat("recording_frame_rate", recordingFrameRate);

    return options;
}

From source file:com.nikhilnayak.games.octoshootar.ui.fragments.GameScoreFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(BUNDLE_IS_DISPLAY_DONE, mIsDisplayDone);
    outState.putFloat(BUNDLE_CURRENT_FINAL_SCORE, mCurrentFinalScore);
    outState.putBoolean(BUNDLE_CURRENT_ACHIEVEMENT_CHECKED, mAchievementChecked);
    outState.putBoolean(BUNDLE_CURRENT_PLAYER_PROFILE_SAVED, mPlayerProfileSaved);
    outState.putFloat(BUNDLE_CURRENT_EXP_EARNED, mCurrentExpEarned);
    outState.putBoolean(BUNDLE_HAS_LEVELED_UP, mHasLeveledUp);
    outState.putBoolean(BUNDLE_HAS_INCREASED_RANK, mHasIncreaseRank);
}

From source file:com.softminds.matrixcalculator.OperationFragments.InverseFragment.java

public void RunAndGetDeterminantWithAdjoint(final int i, final ProgressDialog progressDialog) {
    Runnable runnable = new Runnable() {
        @Override/* w w  w.j  a  v  a  2s  . c o m*/
        public void run() {
            Message message = new Message();
            Bundle bundle = new Bundle();
            float detr = (float) SquareList.get(i).getDeterminant(progressDialog);
            if (detr == 0.0f) {
                myHandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(getContext(), R.string.NoInverse, Toast.LENGTH_SHORT).show();
                    }
                }, 0);
                progressDialog.dismiss();
            } else {
                progressDialog.setProgress(0);
                bundle.putFloat("DETERMINANT", detr);
                MatrixV2 res = SquareList.get(i).getAdjoint(progressDialog);
                bundle.putAll(res.getDataBundled());
                message.setData(bundle);
                myHandler.sendMessage(message);
            }

        }
    };
    Thread thread = new Thread(runnable);
    thread.start();
}

From source file:biz.bokhorst.bpt.BPTService.java

private void sendLocation(Location location) {
    Bundle b = new Bundle();
    b.putDouble("Latitude", location.getLatitude());
    b.putDouble("Longitude", location.getLongitude());
    b.putDouble("Altitude", location.getAltitude());
    b.putFloat("Speed", location.getSpeed());
    b.putFloat("Accuracy", location.getAccuracy());
    b.putString("Provider", location.getProvider());
    b.putLong("Time", location.getTime());
    sendMessage(BackPackTrack.MSG_LOCATION, b);
}

From source file:com.nextgis.mobile.InputPointActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    if (descriptfrag != null)
        descriptfrag.onStoreValues();/*from   w ww.  j  a v  a  2  s  . com*/
    if (positionfrag != null)
        positionfrag.onStoreValues();
    if (camfrag != null)
        camfrag.onStoreValues();
    if (notefrag != null)
        notefrag.onStoreValues();

    outState.putString("cat", m_sCat);
    outState.putString("subcat", m_sSubCat);
    outState.putFloat("az", m_fAzimuth);
    outState.putFloat("dist", m_fDist);
    outState.putString("note", m_sNote);
    outState.putStringArrayList("photos", image_lst);
    int nAzArraySize = image_rotation.size();
    double[] adfAz = new double[nAzArraySize];
    for (int i = 0; i < nAzArraySize; i++)
        adfAz[i] = image_rotation.get(i);

    outState.putDoubleArray("photos_az", adfAz);
}

From source file:com.ibm.mf.geofence.demo.MapsActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (currentLocation != null) {
        outState.putDoubleArray("currentLocation",
                new double[] { currentLocation.getLatitude(), currentLocation.getLongitude() });
    }/*w ww  . ja  v a2 s  .  c om*/
    if (googleMap != null) {
        outState.putFloat("zoom", googleMap.getCameraPosition().zoom);
    }
    //log.debug("onSaveInstanceState()");
}