Example usage for android.os Bundle getDouble

List of usage examples for android.os Bundle getDouble

Introduction

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

Prototype

public double getDouble(String key) 

Source Link

Document

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

Usage

From source file:org.onebusaway.android.map.StopsRequest.java

@Override
public void setState(Bundle args) {
    if (args != null) {
        Location center = null;//from w  w w  .ja v  a  2  s . co m
        float mapZoom = args.getFloat(MapParams.ZOOM, MapParams.DEFAULT_ZOOM);

        double lat = args.getDouble(MapParams.CENTER_LAT);
        double lon = args.getDouble(MapParams.CENTER_LON);
        if (lat != 0.0 && lon != 0.0) {
            center = LocationUtils.makeLocation(lat, lon);
        }
        mCallback.getMapView().setZoom(mapZoom);

        if (center != null) {
            mCallback.getMapView().setMapCenter(center, false, false);
            onLocation();
        } else {
            mCallback.setMyLocation(false, false);
        }
    } else {
        mCallback.setMyLocation(false, false);
    }
}

From source file:com.spoiledmilk.ibikecph.favorites.AddFavoriteFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (data != null) {
        Bundle b = data.getExtras();
        if (b.containsKey("address") && b.containsKey("lat") && b.containsKey("lon")) {
            String address = AddressParser.textFromBundle(b).replace("\n", "");
            favoritesData = new FavoritesData(textFavoriteName.getText().toString(), address,
                    currentFavoriteType, b.getDouble("lat"), b.getDouble("lon"), -1);
            textAddress.setText(address);
            if (b.containsKey("poi")) {
                textFavoriteName.setText(b.getString("poi"));
            }/*  w  w  w .j  av  a 2  s  . c  om*/
        }

    }

}

From source file:eu.geopaparazzi.library.forms.FragmentDetailActivity.java

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

    // don't permit rotation
    int currentOrientation = getResources().getConfiguration().orientation;
    if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    } else {//from  w ww .  j  a  va  2  s.com
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }

    if (savedInstanceState != null) {
        formName = savedInstanceState.getString(FormUtilities.ATTR_FORMNAME);
    }
    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        noteId = extras.getLong(LibraryConstants.DATABASE_ID);
        formName = extras.getString(FormUtilities.ATTR_FORMNAME);
        sectionObjectString = extras.getString(FormUtilities.ATTR_SECTIONOBJECTSTR);
        try {
            sectionObject = new JSONObject(sectionObjectString);
        } catch (JSONException e) {
            GPLog.error(this, null, e);
        }
        longitude = extras.getDouble(LibraryConstants.LONGITUDE);
        latitude = extras.getDouble(LibraryConstants.LATITUDE);
    }

    setContentView(R.layout.details_activity_layout);
}

From source file:org.sufficientlysecure.keychain.ui.ViewKeySecurityTokenFragment.java

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

    Bundle args = getArguments();
    ByteBuffer buf = ByteBuffer.wrap(args.getByteArray(ARG_FINGERPRINT));
    mFingerprints = new byte[buf.remaining() / 20][];
    for (int i = 0; i < mFingerprints.length; i++) {
        mFingerprints[i] = new byte[20];
        buf.get(mFingerprints[i]);/*from ww w.  j a v a  2 s  . c o m*/
    }
    mUserId = args.getString(ARG_USER_ID);
    mCardAid = args.getByteArray(ARG_CARD_AID);
    mCardVersion = args.getDouble(ARG_CARD_VERSION);

    mMasterKeyId = args.getLong(ARG_MASTER_KEY_ID);

    getLoaderManager().initLoader(0, null, this);

}

From source file:edu.umb.subway.DialogActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle bundle = getIntent().getExtras();

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.infowindow_layout);

    stationId = bundle.getString("station_id");
    stationName = bundle.getString("station_name");
    color = bundle.getInt("color");
    desLat = bundle.getDouble("lat");
    desLon = bundle.getDouble("lon");
    stopInformationList = new ArrayList<StopInformation>();
    stationNameTextView = (TextView) findViewById(R.id.station_name);
    stationInfoTextView = (TextView) findViewById(R.id.station_info);

    stationNameTextView.setText(stationName);
    stationNameTextView.setBackgroundColor(color);

    ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
    if (networkInfo != null && networkInfo.isConnected()) {
        webServiveThread = new Thread(webServiceRunnable);
        webServiveThread.start();// w w  w.java2s. c o m
    } else {
        stationInfoTextView.setText("No network connection available");
        stationInfoTextView.setVisibility(View.VISIBLE);
    }
}

From source file:com.spoiledmilk.ibikecph.favorites.EditFavoriteFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null) {
        Bundle b = data.getExtras();
        if (b.containsKey("address") && b.containsKey("lat") && b.containsKey("lon")) {
            favoritesData.setAdress(AddressParser.textFromBundle(b).replaceAll("\n", ""));
            favoritesData.setLatitude(b.getDouble("lat"));
            favoritesData.setLongitude(b.getDouble("lon"));
            String txt = favoritesData.getAdress();
            textAddress.setText(txt);/*from   www.j a  v  a2 s.c  om*/
            if (b.containsKey("poi")) {
                favoritesData.setName(b.getString("poi"));
            }
        }
    }

}

From source file:com.microhealthllc.mbmicalc.BmiChartRed.java

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

    bar1 = (ColorArcProgressBar) findViewById(R.id.bar1);
    menumainred = (FloatingActionMenu) findViewById(R.id.menu_red);
    bmi_note = (TextView) findViewById(R.id.bmi_note);
    bmitext = (TextView) findViewById(R.id.bmi_display);
    displayname = (TextView) findViewById(R.id.displayname);
    displayheight = (TextView) findViewById(R.id.display_height);
    displayweight = (TextView) findViewById(R.id.display_weight);
    displaybmi = (TextView) findViewById(R.id.display_bmi);
    weightter = new ArrayList<>();
    db = new DBHandler(this);
    enteredit_fab = (FloatingActionButton) findViewById(R.id.enter_edit_data);
    weight_graphfab = (FloatingActionButton) findViewById(R.id.bmi_graph);
    bmi_logsfab = (FloatingActionButton) findViewById(R.id.bmi_logs);
    bmi_info = (FloatingActionButton) findViewById(R.id.bmi_info);
    lastactivty = (TextView) findViewById(R.id.last_activity);
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    //   unit_settingsfab = (FloatingActionButton) findViewById(R.id.unitsettings);
    // Enable the Up button
    // ab.setDisplayHomeAsUpEnabled(true);

    viewmore = (Button) findViewById(R.id.view_more);

    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setTitle("BMI Calculator");

    }/*from   ww w  .ja  v  a2  s. c  o  m*/
    //   ab.setDisplayHomeAsUpEnabled(true);

    setUpNavigationDrawer();

    mAdapter = new LogListAdapter(logList);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());

    recyclerView.setAdapter(mAdapter);

    // *** TOP LINE CHART ***
    //   chartTop = (LineChartView) findViewById(R.id.chart_top);

    // generateInitialLineData();
    sharedPref = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    Log.i("Get curr time", getDateTimeforLastActivity());
    SharedPreferences SP = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    metrics = SP.getInt(getString(R.string.metric_settings), 0);

    viewmore.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(BmiChartRed.this, LogActivity.class);
            startActivity(i);
        }
    });

    if (sharedPref.getString(getString(R.string.last_activity), "").isEmpty()) {
        lastactivty.setText(sharedPref.getString(getString(R.string.last_activity), ""));
    }

    Bundle bundle = getIntent().getExtras();

    if (bundle != null) {
        gotheight = bundle.getDouble("height");
        gotWeight = bundle.getDouble("weight");
        bmifunc(gotheight, gotWeight);
    } else {
        bar1.setCurrentValues(Double.parseDouble(sharedPref.getString(getString(R.string.display_bmi), "0.0")));

        // Log.i("getweight gotheight",   gotheight+","+gotWeight);

        bmi_note.setText(sharedPref.getString(getString(R.string.display_note), "normal"));
        displayheight.setText(sharedPref.getString(getString(R.string.display_height), "0"));
        displayweight.setText(sharedPref.getString(getString(R.string.display_weight), "0"));
        displaybmi.setText(sharedPref.getString(getString(R.string.display_bmi), "0.0"));

    }

    displayname.setText(SP.getString(getString(R.string.metric_user_name), "User"));
    enteredit_fab.setOnClickListener(clickListener);
    weight_graphfab.setOnClickListener(clickListener);
    bmi_logsfab.setOnClickListener(clickListener);
    bmi_info.setOnClickListener(clickListener);

    //  unit_settingsfab.setOnClickListener(clickListener);

    prepareMovieData();

}

From source file:com.microhealthllc.mbmicalc.BmiChartBloodRed.java

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

    bar1 = (ColorArcProgressBar) findViewById(R.id.bar1);
    menumainred = (FloatingActionMenu) findViewById(R.id.menu_red);
    bmi_note = (TextView) findViewById(R.id.bmi_note);
    bmitext = (TextView) findViewById(R.id.bmi_display);
    displayname = (TextView) findViewById(R.id.displayname);
    displayheight = (TextView) findViewById(R.id.display_height);
    displayweight = (TextView) findViewById(R.id.display_weight);
    displaybmi = (TextView) findViewById(R.id.display_bmi);
    weightter = new ArrayList<>();
    db = new DBHandler(this);
    enteredit_fab = (FloatingActionButton) findViewById(R.id.enter_edit_data);
    bmi_info = (FloatingActionButton) findViewById(R.id.bmi_info);
    weight_graphfab = (FloatingActionButton) findViewById(R.id.bmi_graph);
    bmi_logsfab = (FloatingActionButton) findViewById(R.id.bmi_logs);
    lastactivty = (TextView) findViewById(R.id.last_activity);
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    //   unit_settingsfab = (FloatingActionButton) findViewById(R.id.unitsettings);
    // Enable the Up button
    // ab.setDisplayHomeAsUpEnabled(true);

    viewmore = (Button) findViewById(R.id.view_more);

    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setTitle("BMI Calculator");

    }/* www  . ja v a2s  .co m*/
    //   ab.setDisplayHomeAsUpEnabled(true);

    setUpNavigationDrawer();

    mAdapter = new LogListAdapter(logList);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());

    recyclerView.setAdapter(mAdapter);

    // *** TOP LINE CHART ***
    //   chartTop = (LineChartView) findViewById(R.id.chart_top);

    // generateInitialLineData();
    sharedPref = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    Log.i("Get curr time", getDateTimeforLastActivity());
    SharedPreferences SP = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    metrics = SP.getInt(getString(R.string.metric_settings), 0);

    viewmore.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(BmiChartBloodRed.this, LogActivity.class);
            startActivity(i);
        }
    });

    if (sharedPref.getString(getString(R.string.last_activity), "").isEmpty()) {
        lastactivty.setText(sharedPref.getString(getString(R.string.last_activity), ""));
    }

    Bundle bundle = getIntent().getExtras();

    if (bundle != null) {
        gotheight = bundle.getDouble("height");
        gotWeight = bundle.getDouble("weight");
        bmifunc(gotheight, gotWeight);
    } else {
        bar1.setCurrentValues(Double.parseDouble(sharedPref.getString(getString(R.string.display_bmi), "0.0")));

        // Log.i("getweight gotheight",   gotheight+","+gotWeight);

        bmi_note.setText(sharedPref.getString(getString(R.string.display_note), "normal"));
        displayheight.setText(sharedPref.getString(getString(R.string.display_height), "0"));
        displayweight.setText(sharedPref.getString(getString(R.string.display_weight), "0"));
        displaybmi.setText(sharedPref.getString(getString(R.string.display_bmi), "0.0"));

    }

    displayname.setText(SP.getString(getString(R.string.metric_user_name), "User"));
    enteredit_fab.setOnClickListener(clickListener);
    weight_graphfab.setOnClickListener(clickListener);
    bmi_logsfab.setOnClickListener(clickListener);
    bmi_info.setOnClickListener(clickListener);

    //  unit_settingsfab.setOnClickListener(clickListener);

    prepareMovieData();

}

From source file:com.microhealthllc.mbmicalc.BmiChartOrange.java

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

    bar1 = (ColorArcProgressBar) findViewById(R.id.bar1);
    menumainred = (FloatingActionMenu) findViewById(R.id.menu_red);
    bmi_note = (TextView) findViewById(R.id.bmi_note);
    bmitext = (TextView) findViewById(R.id.bmi_display);
    displayname = (TextView) findViewById(R.id.displayname);
    displayheight = (TextView) findViewById(R.id.display_height);
    displayweight = (TextView) findViewById(R.id.display_weight);
    displaybmi = (TextView) findViewById(R.id.display_bmi);
    weightter = new ArrayList<>();
    db = new DBHandler(this);
    enteredit_fab = (FloatingActionButton) findViewById(R.id.enter_edit_data);
    weight_graphfab = (FloatingActionButton) findViewById(R.id.bmi_graph);
    bmi_logsfab = (FloatingActionButton) findViewById(R.id.bmi_logs);
    bmi_info = (FloatingActionButton) findViewById(R.id.bmi_info);
    lastactivty = (TextView) findViewById(R.id.last_activity);
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    //   unit_settingsfab = (FloatingActionButton) findViewById(R.id.unitsettings);
    // Enable the Up button
    // ab.setDisplayHomeAsUpEnabled(true);

    viewmore = (Button) findViewById(R.id.view_more);

    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setTitle("BMI Calculator");

    }/*from w w  w. ja v a2 s  .  c  o  m*/
    //   ab.setDisplayHomeAsUpEnabled(true);

    setUpNavigationDrawer();

    mAdapter = new LogListAdapter(logList);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());

    recyclerView.setAdapter(mAdapter);

    // *** TOP LINE CHART ***
    //   chartTop = (LineChartView) findViewById(R.id.chart_top);

    // generateInitialLineData();
    sharedPref = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    Log.i("Get curr time", getDateTimeforLastActivity());
    SharedPreferences SP = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    metrics = SP.getInt(getString(R.string.metric_settings), 0);

    viewmore.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(BmiChartOrange.this, LogActivity.class);
            startActivity(i);
        }
    });

    if (sharedPref.getString(getString(R.string.last_activity), "").isEmpty()) {
        lastactivty.setText(sharedPref.getString(getString(R.string.last_activity), ""));
    }

    Bundle bundle = getIntent().getExtras();

    if (bundle != null) {
        gotheight = bundle.getDouble("height");
        gotWeight = bundle.getDouble("weight");
        bmifunc(gotheight, gotWeight);
    } else {
        bar1.setCurrentValues(Double.parseDouble(sharedPref.getString(getString(R.string.display_bmi), "0.0")));

        // Log.i("getweight gotheight",   gotheight+","+gotWeight);

        bmi_note.setText(sharedPref.getString(getString(R.string.display_note), "normal"));
        displayheight.setText(sharedPref.getString(getString(R.string.display_height), "0"));
        displayweight.setText(sharedPref.getString(getString(R.string.display_weight), "0"));
        displaybmi.setText(sharedPref.getString(getString(R.string.display_bmi), "0.0"));

    }

    displayname.setText(SP.getString(getString(R.string.metric_user_name), "User"));
    enteredit_fab.setOnClickListener(clickListener);
    weight_graphfab.setOnClickListener(clickListener);
    bmi_logsfab.setOnClickListener(clickListener);
    bmi_info.setOnClickListener(clickListener);

    //  unit_settingsfab.setOnClickListener(clickListener);

    prepareMovieData();

}

From source file:com.microhealthllc.mbmicalc.BmiChartyellow.java

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

    bar1 = (ColorArcProgressBar) findViewById(R.id.bar1);
    menumainred = (FloatingActionMenu) findViewById(R.id.menu_red);
    bmi_note = (TextView) findViewById(R.id.bmi_note);
    bmitext = (TextView) findViewById(R.id.bmi_display);
    displayname = (TextView) findViewById(R.id.displayname);
    displayheight = (TextView) findViewById(R.id.display_height);
    displayweight = (TextView) findViewById(R.id.display_weight);
    displaybmi = (TextView) findViewById(R.id.display_bmi);
    weightter = new ArrayList<>();
    db = new DBHandler(this);
    enteredit_fab = (FloatingActionButton) findViewById(R.id.enter_edit_data);
    weight_graphfab = (FloatingActionButton) findViewById(R.id.bmi_graph);
    bmi_logsfab = (FloatingActionButton) findViewById(R.id.bmi_logs);
    bmi_info = (FloatingActionButton) findViewById(R.id.bmi_info);
    lastactivty = (TextView) findViewById(R.id.last_activity);
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    //   unit_settingsfab = (FloatingActionButton) findViewById(R.id.unitsettings);
    // Enable the Up button
    // ab.setDisplayHomeAsUpEnabled(true);

    viewmore = (Button) findViewById(R.id.view_more);

    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setTitle("BMI Calculator");

    }/*w  w  w .java2s.c o m*/
    //   ab.setDisplayHomeAsUpEnabled(true);

    setUpNavigationDrawer();

    mAdapter = new LogListAdapter(logList);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());

    recyclerView.setAdapter(mAdapter);

    // *** TOP LINE CHART ***
    //   chartTop = (LineChartView) findViewById(R.id.chart_top);

    // generateInitialLineData();
    sharedPref = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    Log.i("Get curr time", getDateTimeforLastActivity());
    SharedPreferences SP = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    metrics = SP.getInt(getString(R.string.metric_settings), 0);

    viewmore.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i = new Intent(BmiChartyellow.this, LogActivity.class);
            startActivity(i);
        }
    });

    if (sharedPref.getString(getString(R.string.last_activity), "").isEmpty()) {
        lastactivty.setText(sharedPref.getString(getString(R.string.last_activity), ""));
    }

    Bundle bundle = getIntent().getExtras();

    if (bundle != null) {
        gotheight = bundle.getDouble("height");
        gotWeight = bundle.getDouble("weight");
        bmifunc(gotheight, gotWeight);
    } else {
        bar1.setCurrentValues(Double.parseDouble(sharedPref.getString(getString(R.string.display_bmi), "0.0")));

        // Log.i("getweight gotheight",   gotheight+","+gotWeight);

        bmi_note.setText(sharedPref.getString(getString(R.string.display_note), "normal"));
        displayheight.setText(sharedPref.getString(getString(R.string.display_height), "0"));
        displayweight.setText(sharedPref.getString(getString(R.string.display_weight), "0"));
        displaybmi.setText(sharedPref.getString(getString(R.string.display_bmi), "0.0"));

    }

    displayname.setText(SP.getString(getString(R.string.metric_user_name), "User"));
    enteredit_fab.setOnClickListener(clickListener);
    weight_graphfab.setOnClickListener(clickListener);
    bmi_logsfab.setOnClickListener(clickListener);
    bmi_info.setOnClickListener(clickListener);

    //  unit_settingsfab.setOnClickListener(clickListener);

    prepareMovieData();

}