当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.putDouble方法代码示例

本文整理汇总了Java中android.os.Bundle.putDouble方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putDouble方法的具体用法?Java Bundle.putDouble怎么用?Java Bundle.putDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.putDouble方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: eventCalculate

import android.os.Bundle; //导入方法依赖的package包/类
public static void eventCalculate(Context context,Course course, double grade){
    //Fabric
    Answers.getInstance().logCustom(new CustomEvent(AnalyticsConstants.EVENT_CALCULATION)
            .putCustomAttribute("Course name", course.getName())
            .putCustomAttribute("Course code", course.getCode())
            .putCustomAttribute("Result", grade));

    //Firebase
    Bundle params = new Bundle();
    params.putString("course_name",course.getName());
    params.putString("course_code",course.getCode());
    params.putDouble("result",grade);
    FirebaseAnalytics.getInstance(context).logEvent(AnalyticsConstants.EVENT_CALCULATION,params);

    //Amplitude
    try {
        Amplitude.getInstance().logEvent(AnalyticsConstants.EVENT_CALCULATION, new JSONObject()
                .put("Course name",course.getName())
                .put("Course code",course.getCode())
                .put("Result",grade));
    } catch (JSONException e) {
        Crashlytics.logException(e);
    }

}
 
开发者ID:Bruno125,项目名称:Unofficial-Ups,代码行数:26,代码来源:AnalyticsManager.java

示例2: freeze

import android.os.Bundle; //导入方法依赖的package包/类
public void freeze(Bundle bundle) {

        bundle.putParcelable("mBitmap", mBitmap);
        
        bundle.putDouble("mX", mX);
        bundle.putDouble("mXv", mXv);
        bundle.putDouble("mY", mY);
        bundle.putDouble("mYv", mYv);
        bundle.putDouble("mSpinv", mSpinv);
        
        bundle.putDouble("mSpin", mSpin);
        bundle.putBoolean("mBoom", mBoom);
        bundle.putString("mText", mText);
        bundle.putBoolean("fade", fade);


        bundle.putInt("mPaintColor", mPaint.getColor());
        bundle.putInt("mPaintAlpha", mPaint.getAlpha());
        bundle.putDouble("mScale", mScale);
        bundle.putBoolean("mHit", mHit);
        bundle.putDouble("mValue", mValue);

    }
 
开发者ID:quaap,项目名称:SeafoodBerserker,代码行数:24,代码来源:FlyingItem.java

示例3: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
    //This MUST be done before saving any of your own or your base class's variables
    final Bundle mapViewSaveState = new Bundle(outState);
    if (mapView != null)
        mapView.onSaveInstanceState(mapViewSaveState);
    outState.putBundle(MAP_VIEW_SAVED_STATE, mapViewSaveState);

    super.onSaveInstanceState(outState);
    outState.putParcelable(EVENT_BITMAP_SAVED_STATE, eventBitmapIntent);
    outState.putParcelableArrayList(ADDED_USERS_SAVED_STATE, addedUsers);
    outState.putInt(YEAR_SAVED_STATE, year);
    outState.putInt(MONTH_SAVED_SAVED_STATE, month);
    outState.putInt(DAY_OF_MONTH_SAVED_STATE, dayOfMonth);
    outState.putInt(HOUR_SAVED_STATE, hour);
    outState.putInt(MINUTES_SAVED_STATE, minutes);
    outState.putDouble(EVENT_LATITUDE_SAVED_STATE, latitude);
    outState.putDouble(EVENT_LONGITUDE_SAVED_STATE, longitude);
    outState.putString(EVENT_ISO3_CODE_SAVED_STATE, iso3);
}
 
开发者ID:GrenderG,项目名称:Protestr,代码行数:21,代码来源:CreateEventActivity.java

示例4: getInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static ConversionDialog getInstance(Card card, boolean addSwapButton){
    Bundle args = new Bundle();
    args.putDouble(DOUBLE_TAG, card.getCurrentRate());
    args.putString(FROM_TAG, card.getFrom());
    args.putString(TO_TAG, card.getTo());
    args.putBoolean(SWAP, addSwapButton);

    ConversionDialog dialog = new ConversionDialog();
    dialog.setArguments(args);
    return dialog;
}
 
开发者ID:aumarbello,项目名称:ALCAssessment,代码行数:12,代码来源:ConversionDialog.java

示例5: returnValue

import android.os.Bundle; //导入方法依赖的package包/类
private void returnValue(double d) {
    Bundle bundle = new Bundle();
    bundle.putDouble(COMPUTED_TIME, d);
    hideKeyboard();

    Intent mIntent = new Intent();
    mIntent.putExtras(bundle);
    setResult(RESULT_OK, mIntent);
}
 
开发者ID:ericberman,项目名称:MyFlightbookAndroid,代码行数:10,代码来源:ActTimeCalc.java

示例6: loadProfileDetailsOf

import android.os.Bundle; //导入方法依赖的package包/类
private void loadProfileDetailsOf(String userId) {
    ProfileDetailFragment fragment = new ProfileDetailFragment();
    Bundle args = new Bundle();
    args.putInt("theme", color);
    //        args.putString(ViMarket.product_ID, productId);
    args.putString(ViMarket.user_ID,userId);
    args.putString(ViMarket.currency_ID, cur);
    args.putDouble(ViMarket.currency_RATE, rate);
    fragment.setArguments(args);
    getSupportFragmentManager().beginTransaction().replace(R.id.product_detail_container, fragment).commit();
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:12,代码来源:ProfilePage.java

示例7: loadproductDetailsOf

import android.os.Bundle; //导入方法依赖的package包/类
private void loadproductDetailsOf(String productId, String userId) {
    ProductDetailFragment fragment = new ProductDetailFragment();
    Bundle args = new Bundle();

    args.putString(ViMarket.product_ID, productId);
    args.putString(ViMarket.user_ID, userId);
    args.putDouble(ViMarket.currency_RATE, session.getCurrency());
    fragment.setArguments(args);
    getFragmentManager().beginTransaction().replace(R.id.product_detail_container, fragment).commit();
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:11,代码来源:ProductDetailActivity.java

示例8: setBundleValue

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * @param typeDef type
 * @param key     key
 * @param value   value
 */
public static void setBundleValue(Bundle bundle, Integer typeDef, String key, String value) {
    if (TextUtils.isEmpty(key) || TextUtils.isEmpty(value)) {
        return;
    }

    try {
        if (null != typeDef) {
            if (typeDef == Type.BOOLEAN.ordinal()) {
                bundle.putBoolean(key, Boolean.parseBoolean(value));
            } else if (typeDef == Type.BYTE.ordinal()) {
                bundle.putByte(key, Byte.valueOf(value));
            } else if (typeDef == Type.SHORT.ordinal()) {
                bundle.putShort(key, Short.valueOf(value));
            } else if (typeDef == Type.INT.ordinal()) {
                bundle.putInt(key, Integer.valueOf(value));
            } else if (typeDef == Type.LONG.ordinal()) {
                bundle.putLong(key, Long.valueOf(value));
            } else if (typeDef == Type.FLOAT.ordinal()) {
                bundle.putFloat(key, Float.valueOf(value));
            } else if (typeDef == Type.DOUBLE.ordinal()) {
                bundle.putDouble(key, Double.valueOf(value));
            } else if (typeDef == Type.STRING.ordinal()) {
                bundle.putString(key, value);
            } else if (typeDef == Type.PARCELABLE.ordinal()) {
            } else if (typeDef == Type.OBJECT.ordinal()) {
                bundle.putString(key, value);
            } else {
                bundle.putString(key, value);
            }
        } else {
            bundle.putString(key, value);
        }
    } catch (Throwable ex) {
    }
}
 
开发者ID:luojilab,项目名称:DDComponentForAndroid,代码行数:41,代码来源:UriUtils.java

示例9: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(PARAM_FROM_DATE, this.fromDate);
    outState.putLong(PARAM_TO_DATE, this.toDate);
    outState.putDouble(PARAM_KWH_COST, this.kwhCost);
}
 
开发者ID:brolam,项目名称:OpenHomeAnalysis,代码行数:8,代码来源:OhaEnergyUseBillFragment.java

示例10: toBundle

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Convert a {@link WritableMap} to a {@link Bundle}.
 * @param readableMap the {@link WritableMap} to convert.
 * @return the converted {@link Bundle}.
 */
@Nullable
public static Bundle toBundle(@Nullable ReadableMap readableMap) {
  if (readableMap == null) {
    return null;
  }

  ReadableMapKeySetIterator iterator = readableMap.keySetIterator();

  Bundle bundle = new Bundle();
  while (iterator.hasNextKey()) {
    String key = iterator.nextKey();
    ReadableType readableType = readableMap.getType(key);
    switch (readableType) {
      case Null:
        bundle.putString(key, null);
        break;
      case Boolean:
        bundle.putBoolean(key, readableMap.getBoolean(key));
        break;
      case Number:
        // Can be int or double.
        bundle.putDouble(key, readableMap.getDouble(key));
        break;
      case String:
        bundle.putString(key, readableMap.getString(key));
        break;
      case Map:
        bundle.putBundle(key, toBundle(readableMap.getMap(key)));
        break;
      case Array:
        // TODO t8873322
        throw new UnsupportedOperationException("Arrays aren't supported yet.");
      default:
        throw new IllegalArgumentException("Could not convert object with key: " + key + ".");
    }
  }

  return bundle;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:45,代码来源:Arguments.java

示例11: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Creates a new instance of the edit event dialog with the given parameters
 * @param comment Event Comment
 * @param location
 * @return
 */
public static EditHabitEventDialog newInstance(String comment, Location location ) {
    EditHabitEventDialog dialog= new EditHabitEventDialog();
    Bundle args = new Bundle();
    args.putString("Comments", comment);
    if (location != null){
        args.putDouble("latitude", location.getLatitude());
        args.putDouble("longitude", location.getLongitude());
    }
    dialog.setArguments(args);
    return dialog;
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:18,代码来源:EditHabitEventDialog.java

示例12: onSaveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Overridden to save instance state when device orientation changes. This method is called automatically if you assign an id to the RangeSeekBar widget using the {@link #setId(int)} method. Other members of this class than the normalized min and max values don't need to be saved.
 */
@Override
protected Parcelable onSaveInstanceState() {
    final Bundle bundle = new Bundle();
    bundle.putParcelable("SUPER", super.onSaveInstanceState());
    bundle.putDouble("MIN", normalizedMinValue);
    bundle.putDouble("MAX", normalizedMaxValue);
    return bundle;
}
 
开发者ID:Tamicer,项目名称:FilterBar,代码行数:12,代码来源:RangeSeekBar.java

示例13: setOnBundle

import android.os.Bundle; //导入方法依赖的package包/类
public void setOnBundle(Bundle bundle, String key, Object value) throws JSONException {
    bundle.putDouble(key, (Double) value);
}
 
开发者ID:ShengLe0701,项目名称:react-native-upload-file,代码行数:4,代码来源:BundleJSONConverter.java

示例14: putDouble

import android.os.Bundle; //导入方法依赖的package包/类
public void putDouble(Bundle state, String key, double x) {
    state.putDouble(key + baseKey, x);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Injector.java

示例15: onClick

import android.os.Bundle; //导入方法依赖的package包/类
public void onClick(View v) {

        if (v.getId() == R.id.choosedate_button){

            Spinner spinner = (Spinner) findViewById(R.id.book_spinner);
            String bookTitle = spinner.getSelectedItem().toString();

            Intent I = new Intent(getApplicationContext(), LoginHold.class);

            //***GET PASSED INFO***
            Bundle extras= getIntent().getExtras();
            //PickUp
            int pulledPickUpDayOfYear = extras.getInt("pickUpDayOfYear");
            String pulledYear = extras.getString("pickUpYear");
            String pickUpMonth = extras.getString("pickUpMonth");
            String pickUpDay = extras.getString("pickUpDay");
            String pulledPickUpHour = extras.getString("pickUpHour");
            String pulledPickUpAmPm = extras.getString("pickUpAmPm");
            //DropOff
            int dropOffDayOfYear = extras.getInt("dropOffDayOfYear");
            String dropOffYear = extras.getString("dropOffYear");
            String dropOffMonth = extras.getString("dropOffMonth");
            String dropOffDay = extras.getString("dropOffDay");
            String dropOffHour = extras.getString("dropOffHour");
            String dropOffAmPm = extras.getString("dropOffAmPm");
            //Transaction
            int rentalHours = extras.getInt("rentalHours");
            String loggedUsername = extras.getString("username");
            int loggedId = extras.getInt("id");

            //rentalTotal
            Double rentalTotal = cost*rentalHours;

            //pass stuff to results
            Bundle extraInfo = new Bundle();

            extraInfo.putInt("rentalHours", rentalHours);

            //pick up data
            extraInfo.putInt("pickUpDayOfYear", pulledPickUpDayOfYear);
            extraInfo.putString("pickUpMonth", pickUpMonth);
            extraInfo.putString("pickUpDay", pickUpDay);
            extraInfo.putString("pickUpYear", pulledYear);
            extraInfo.putString("pickUpHour", pulledPickUpHour);
            extraInfo.putString("pickUpAmPm", pulledPickUpAmPm);

            //Drop off data
            extraInfo.putInt("dropOffDayOfYear", dropOffDayOfYear);
            extraInfo.putString("dropOffYear", dropOffYear);
            //System.out.println("dropOffYear " + year);
            extraInfo.putString("dropOffMonth", dropOffMonth);
            extraInfo.putString("dropOffDay", dropOffDay);
            extraInfo.putString("dropOffHour", dropOffHour);
            extraInfo.putString("dropOffAmPm", dropOffAmPm);

            //transaction stuff
            extraInfo.putString("title", bookTitle);
            extraInfo.putDouble("rentalTotal", rentalTotal);

            I.putExtras(extraInfo);

            startActivity(I);
        }

    }
 
开发者ID:Mikerr1111,项目名称:Library-System-Android,代码行数:66,代码来源:BookResults.java


注:本文中的android.os.Bundle.putDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。