Example usage for android.os Bundle putDouble

List of usage examples for android.os Bundle putDouble

Introduction

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

Prototype

public void putDouble(@Nullable String key, double value) 

Source Link

Document

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

Usage

From source file:com.prey.json.actions.Geofencing.java

public void start(Context ctx, List<ActionResult> lista, JSONObject parameters) {

    try {/*w  w w .  ja v a2 s. c  om*/

        String origin = parameters.getString("origin");
        String[] centralPoints = origin.split(",");
        String longitude = centralPoints[0];
        String latitude = centralPoints[1];
        String radius = parameters.getString("radius");

        Bundle bundle = new Bundle();
        bundle.putDouble("longitude", Double.parseDouble(longitude));
        bundle.putDouble("latitude", Double.parseDouble(latitude));
        bundle.putFloat("radius", Float.parseFloat(radius));
        bundle.putInt("type", ProxAlertActivity.START);

        Intent popup = new Intent(ctx, ProxAlertActivity.class);
        popup.putExtras(bundle);
        popup.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        ctx.startActivity(popup);

        PreyLogger.i("Finish Geofencing start");

    } catch (JSONException e) {
        PreyLogger.e("Error en json:" + e.getMessage(), e);
        PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx,
                UtilJson.makeMapParam("start", "geofence", "failed", e.getMessage()));
    }

}

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

private void FindRank(final int pos) {
    Runnable runnable = new Runnable() {
        @Override//ww  w  . j a  v a2  s .co  m
        public void run() {
            MatrixV2 mat = ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(pos);
            double rank = mat.getRank();
            Message message = new Message();
            Bundle bundle = new Bundle();
            bundle.putDouble("CALCULATED_RANK", rank);
            message.setData(bundle);
            handler.sendMessage(message);
        }
    };
    Thread thread = new Thread(runnable);
    thread.start();
}

From source file:anipr.stampitgo.android.Locator.java

public boolean getCurrentLocation() {
    mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
    MainActivity.currentLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
    if (mLastLocation != null) {
        status = true;//from   w  w w .java  2  s.  c o m
        Intent i = new Intent();
        i.setAction("com.stampitgo.location_update");
        lat = mLastLocation.getLatitude();
        lng = mLastLocation.getLongitude();
        Bundle extras = new Bundle();
        extras.putDouble("lat", lat);
        extras.putDouble("lng", lng);
        i.putExtras(extras);

        LocalBroadcastManager.getInstance(AppController.getInstance().getApplicationContext()).sendBroadcast(i);

    } else {
        status = false;
    }
    return status;
}

From source file:de.busse_apps.hmintpmd.gui.MainActivity.java

public void openResultFragment(double value) {
    ResultFragment resultFragment = new ResultFragment();
    Bundle args = new Bundle();
    args.putDouble(ResultFragment.ARGUMENT_VALUE, value);
    addFragment(resultFragment, RESULT_FRAGMENT_TAG, args, true);
}

From source file:com.lvfq.rabbit.activity.MainActivity.java

private void onUpdate(JSONObject jsonObject) {
    try {//from  www.  j a  va  2  s .  c o  m
        if (jsonObject != null) {
            Double serverVersion = jsonObject.getDouble("version");
            if (serverVersion > Double.parseDouble(((MainApplication) getApplication()).getVersion_name())) {
                UpdateDialog updateDialog = new UpdateDialog();
                Bundle args = new Bundle();
                args.putDouble("version", serverVersion);
                args.putString("url", jsonObject.getString("url"));
                args.putString("info", jsonObject.getString("info"));
                updateDialog.setArguments(args);
                updateDialog.show(getSupportFragmentManager(), "update");
            }
        }
    } catch (JSONException e) {
        Log.e(TAG, "JSONException");
    }
}

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

public void RunToGetDeterminant(final int pos, final ProgressDialog px) {
    Runnable runnable = new Runnable() {
        @Override/* w w w.  j a  v  a2s.  c o m*/
        public void run() {
            double var = SquareList.get(pos).getDeterminant(px);
            Message message = new Message();
            Bundle bundle = new Bundle();
            bundle.putDouble("RESULTANT", var);
            message.setData(bundle);
            px.dismiss();
            myhandler.sendMessage(message);

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

From source file:com.crcrch.chromatictuner.app.NotePickerFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putDouble(STATE_FREQUENCY, frequency);
}

From source file:com.esri.android.ecologicalmarineunitexplorer.summary.SummaryFragment.java

public void onSaveInstanceState(Bundle outState) {
    if (mWaterColumn != null) {
        outState.putDouble("X", mWaterColumn.getLocation().getX());
        outState.putDouble("Y", mWaterColumn.getLocation().getY());
        if (mWaterColumn.getLocation().getSpatialReference() != null) {
            outState.putString("SR", mWaterColumn.getLocation().getSpatialReference().getWKText());
        }/*from   www  .  j av  a2 s.c o m*/
        Log.i("SummaryFragment", "Saving instance state");
    }
}

From source file:com.nextgis.maplibui.dialog.SelectZoomLevelsDialog.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putInt(ConstantsUI.KEY_LAYER_ID, mLayerId);
    outState.putDouble(TileDownloadService.KEY_MINX, mEnvelope.getMinX());
    outState.putDouble(TileDownloadService.KEY_MAXX, mEnvelope.getMaxX());
    outState.putDouble(TileDownloadService.KEY_MINY, mEnvelope.getMinY());
    outState.putDouble(TileDownloadService.KEY_MAXY, mEnvelope.getMaxY());
    super.onSaveInstanceState(outState);
}

From source file:org.klnusbaum.udj.containers.Player.java

public Bundle bundleUp() {
    Bundle toReturn = new Bundle();
    toReturn.putString(ID_PARAM, getId());
    toReturn.putString(NAME_PARAM, getName());
    toReturn.putBundle(OWNER_PARAM, getOwner().bundleUp());
    toReturn.putDouble(LATITUDE_PARAM, getLatitude());
    toReturn.putDouble(LONGITUDE_PARAM, getLongitude());
    toReturn.putBoolean(HAS_PASSWORD_PARAM, getHasPassword());
    return toReturn;
}