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.metinkale.prayerapp.vakit.AddCity.java

@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long index) {
    Cities.Item i = mAdapter.getItem(pos);
    if (i != null)
        if (i.source == Source.Calc) {
            Bundle bdl = new Bundle();
            bdl.putString("city", i.city);
            bdl.putDouble("lat", i.lat);
            bdl.putDouble("lng", i.lng);
            CalcTimes.add(this, bdl);
        } else {//from   ww  w .j ava 2 s.  c om
            WebTimes.add(i.source, i.city, i.id, i.lat, i.lng);
            finish();
        }

}

From source file:planets.position.SolarEclipse.java

private void showEclipseData(int num, boolean local) {
    Bundle bundle = new Bundle();
    bundle.putInt("eclipseNum", num);
    bundle.putDouble("Offset", offset);
    bundle.putBoolean("db", true);
    bundle.putBoolean("local", local);
    Intent i = new Intent(this, EclipseData.class);
    i.putExtras(bundle);//www.  ja  v  a2s  . c o  m
    startActivityForResult(i, ECLIPSE_DATA);
}

From source file:com.tvs.signaltracker.MainScreen.java

private void InitUp() {
    if (CommonHandler.ServiceMode < 3) {
        SignalCallBack = new STCallBack() {

            @Override//  w w  w.  j  av  a2 s .  c  o  m
            public void Call(Object argument) {
                SignalObject sig = (SignalObject) argument;
                Bundle data = new Bundle();
                data.putDouble("lat", sig.latitude);
                data.putDouble("lon", sig.longitude);
                data.putShort("signal", sig.signal);
                Message msg = new Message();
                msg.setData(data);
                msg.what = 0;
                if (!MainScreenHandler.sendMessage(msg)) {
                    Log.i("SignalTracker::MainScreen", "Failed to put signal on map. Delaying 2s");
                    MainScreenHandler.sendMessageDelayed(msg, 2000);
                }
            }

        };
        SignalCallBack.from = "MainScreen";

        CommonHandler.AddSignalCallback(SignalCallBack);
        if (CommonHandler.Signals != null) {
            for (int i = 0; i < CommonHandler.Signals.size(); i++)
                SignalCallBack.Call(CommonHandler.Signals.get(i));
        }
    }
    MainScreenHandler.postDelayed(UpdateUI, 100);
}

From source file:ca.ualberta.cmput301w14t08.geochan.fragments.CustomLocationFragment.java

/**
 * Bundles up all arguments required to be passed to previous fragment. This
 * depends on the post type. It will attach latitude, longitude and
 * description of the location to be submitted, as well as the type of
 * location being returned (current location of user or a new location set
 * on the map)//from  w w  w.  ja v a2s.  c  o  m
 * 
 * @param locationType
 *            A string representing the location type that is being
 *            submitted.
 */
public void setBundleArguments(GeoLocation locationToSubmit, String locationType) {
    Bundle bundle = getArguments();
    postType = bundle.getInt("postType");
    if (postType == POST) {
        PostFragment fragment = (PostFragment) getFragmentManager().findFragmentByTag("postFrag");
        if (fragment == null) {
            fragment = (PostFragment) getChildFragmentManager().findFragmentByTag("postFrag");
        }
        Bundle args = fragment.getArguments();
        args.putDouble("LATITUDE", locationToSubmit.getLatitude());
        args.putDouble("LONGITUDE", locationToSubmit.getLongitude());
        args.putString("LocationType", locationType);
        args.putString("locationDescription", locationToSubmit.getLocationDescription());
    } else if (postType == SORT_THREAD) {
        SortUtil.setThreadSortGeo(locationToSubmit);
    } else if (postType == SORT_COMMENT) {
        SortUtil.setCommentSortGeo(locationToSubmit);
    } else if (postType == EDIT) {
        EditFragment fragment = (EditFragment) fragManager.findFragmentByTag("editFrag");
        Bundle args = fragment.getArguments();
        args.putDouble("LATITUDE", locationToSubmit.getLatitude());
        args.putDouble("LONGITUDE", locationToSubmit.getLongitude());
        args.putString("LocationType", locationType);
        args.putString("locationDescription", locationToSubmit.getLocationDescription());
    }
}

From source file:fr.eoit.activity.fragment.iteminfo.PricesDialog.java

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

    outState.putInt("itemId", itemId);
    outState.putInt("chosenPriceId", chosenPriceId);
    outState.putDouble("fixedPrice", fixedPrice);
}

From source file:org.getlantern.firetweet.activity.support.GoogleMapViewerActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Uri uri = getIntent().getData();
    if (uri == null || !AUTHORITY_MAP.equals(uri.getAuthority())) {
        finish();/*  w w  w .  java 2s  .  c o m*/
        return;
    }
    final Bundle bundle = new Bundle();
    final double latitude = ParseUtils.parseDouble(uri.getQueryParameter(QUERY_PARAM_LAT), Double.NaN);
    final double longitude = ParseUtils.parseDouble(uri.getQueryParameter(QUERY_PARAM_LNG), Double.NaN);
    if (Double.isNaN(latitude) || Double.isNaN(longitude)) {
        finish();
        return;
    }
    try {
        bundle.putDouble(EXTRA_LATITUDE, latitude);
        bundle.putDouble(EXTRA_LONGITUDE, longitude);
    } catch (final NumberFormatException e) {
        finish();
        return;
    }
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    final Fragment fragment = isNativeMapSupported() ? new GoogleMapFragment() : new WebMapFragment();
    fragment.setArguments(bundle);
    final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.replace(android.R.id.content, fragment).commit();
}

From source file:org.y20k.trackbook.MainActivityTrackFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putDouble(INSTANCE_LATITUDE_TRACK_MAP, mMapView.getMapCenter().getLatitude());
    outState.putDouble(INSTANCE_LONGITUDE_TRACK_MAP, mMapView.getMapCenter().getLongitude());
    outState.putInt(INSTANCE_ZOOM_LEVEL_TRACK_MAP, mMapView.getZoomLevel());
    outState.putParcelable(INSTANCE_TRACK_TRACK_MAP, mTrack);
    outState.putInt(INSTANCE_CURRENT_TRACK, mCurrentTrack);
    super.onSaveInstanceState(outState);
}

From source file:com.nearnotes.MainActivity.java

public void fetchAllNotes() {
    NoteList newFragment = new NoteList();
    Bundle args = new Bundle();
    args.putDouble("latitude", mLatitude);
    args.putDouble("longitude", mLongitude);
    replaceFragment(newFragment, args);//from  w  w  w .j  a  va  2 s  .c  om

}

From source file:nl.atcomputing.spacetravelagency.fragments.PlaceOrderFragment.java

/**
 * NOTE: setting a fragment retain instance to true will prevent
 * the system from passing the outState bundle in onActivityCreated
 *//*from w  w  w.ja v  a 2  s . co  m*/
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    GoogleMap map = getMap();
    if (map != null) {
        outState.putFloat(BUNDLE_KEY_ZOOM, map.getCameraPosition().zoom);
        outState.putDouble(BUNDLE_KEY_POSITION_LAT, map.getCameraPosition().target.latitude);
        outState.putDouble(BUNDLE_KEY_POSITION_LNG, map.getCameraPosition().target.longitude);
    }

}

From source file:com.rappsantiago.weighttracker.profile.setup.SetGoalsFragment.java

@Override
public Bundle getProfileData() {

    Bundle data = new Bundle();

    String strTargetWeight = mTxtTargetWeightWrapper.getEditText().getText().toString();
    double targetWeight = Util.parseDouble(strTargetWeight, 0.0);

    String strTargetBodyFatIndex = mTxtTargetBodyFatIndexWrapper.getEditText().getText().toString();
    double targetBodyFatIndex = Util.parseDouble(strTargetBodyFatIndex, 0.0);

    data.putDouble(KEY_TARGET_WEIGHT, targetWeight);
    data.putDouble(KEY_TARGET_BODY_FAT_INDEX, targetBodyFatIndex);

    boolean isDueDateChecked = mChkDueDate.isChecked();

    if (isDueDateChecked) {
        data.putLong(KEY_DUE_DATE, mDueDateInMillis);
    } else {/*from w w w  . ja va 2s  .co m*/
        data.putLong(KEY_DUE_DATE, 0L);
    }

    return data;
}