當前位置: 首頁>>代碼示例>>Java>>正文


Java Intent.getDoubleArrayExtra方法代碼示例

本文整理匯總了Java中android.content.Intent.getDoubleArrayExtra方法的典型用法代碼示例。如果您正苦於以下問題:Java Intent.getDoubleArrayExtra方法的具體用法?Java Intent.getDoubleArrayExtra怎麽用?Java Intent.getDoubleArrayExtra使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.Intent的用法示例。


在下文中一共展示了Intent.getDoubleArrayExtra方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initPoint

import android.content.Intent; //導入方法依賴的package包/類
private void initPoint() {
    Intent intent = getIntent();
    double[] start = intent.getDoubleArrayExtra("start");
    double[] end = intent.getDoubleArrayExtra("end");
    sList.add(new NaviLatLng(start[0], start[1]));
    eList.add(new NaviLatLng(end[0], end[1]));
    this.isEmulator = intent.getIntExtra("type", 1) == 0;
    if (this.isEmulator) {
        navigation.setEmulatorNaviSpeed(75);
    }
}
 
開發者ID:luocongqiu,項目名稱:cordova-plugin-navigation,代碼行數:12,代碼來源:NavigationActivity.java

示例2: getValue

import android.content.Intent; //導入方法依賴的package包/類
/**
 * Get a value from an intent by a giving class and key.
 * @param intent
 *  the source intent
 * @param key
 *  the key of the value
 * @param clz
 *  the class of the value
 * @return
 *  the value from the source intent
 */
public static Object getValue(Intent intent, String key, Class<?> clz) {
    Object value = null;
    // Cause it is not an easy job to handle inheritance in apt, it is a lot easier to put the code in the Android environment.
    if(Bundle.class.isAssignableFrom(clz)) {
        // bundle implements parcelable, so it should place before parcelable.
        value = intent.getBundleExtra(key);
    } else if(Parcelable.class.isAssignableFrom(clz)) {
        value = intent.getParcelableExtra(key);
    } else if(Parcelable[].class.isAssignableFrom(clz)) {
        value = intent.getParcelableArrayExtra(key);
    } else if(boolean[].class.isAssignableFrom(clz)) {
        value = intent.getBooleanArrayExtra(key);
    } else if(byte[].class.isAssignableFrom(clz)) {
        value = intent.getByteArrayExtra(key);
    } else if(short[].class.isAssignableFrom(clz)) {
        value = intent.getShortArrayExtra(key);
    } else if(char[].class.isAssignableFrom(clz)) {
        value = intent.getCharArrayExtra(key);
    } else if(int[].class.isAssignableFrom(clz)) {
        value = intent.getIntArrayExtra(key);
    } else if(long[].class.isAssignableFrom(clz)) {
        value = intent.getLongArrayExtra(key);
    } else if(float[].class.isAssignableFrom(clz)) {
        value = intent.getFloatArrayExtra(key);
    } else if(double[].class.isAssignableFrom(clz)) {
        value = intent.getDoubleArrayExtra(key);
    } else if(String[].class.isAssignableFrom(clz)) {
        value = intent.getStringArrayExtra(key);
    } else if(CharSequence[].class.isAssignableFrom(clz)) {
        value = intent.getCharSequenceArrayExtra(key);
    } else if(Serializable.class.isAssignableFrom(clz)) {
        // some of the above are assignable for serializable, so serializable should be in the last place.
        value = intent.getSerializableExtra(key);
    } else {
        throw new RuntimeException(clz + " is not compatible with intent (key=" + key + ")");
    }

    return value;
}
 
開發者ID:foreveruseful,項目名稱:smartkey,代碼行數:51,代碼來源:IntentValueGetter.java

示例3: onCreate

import android.content.Intent; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_calc_attenuation);
    Intent intent = getIntent();
    fEnergyList = intent.getDoubleArrayExtra(DisplayMaterialActivity.ATTEN_ENERGY);
    fCoeffList = intent.getDoubleArrayExtra(DisplayMaterialActivity.ATTEN_COEFF);
    fDensity = intent.getDoubleExtra(SearchOptionSelect.SEARCH_OBJECT_DENSITY, 0.0);
    EditText editTextDensity = (EditText) findViewById(R.id.editTextDensity);
    editTextDensity.setText(Double.toString(fDensity));
}
 
開發者ID:JW1992,項目名稱:NISTGammaSearch,代碼行數:12,代碼來源:CalcAttenuationActivity.java

示例4: onActivityResult

import android.content.Intent; //導入方法依賴的package包/類
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == GAME_ACTIVITY_CODE) {
        if (resultCode == RESULT_OK) {
            // Benchmark passed
            mSetUpTimes = data.getDoubleArrayExtra(GLGameActivity.SET_UP_TIME);
            mUpdateTimes = data.getDoubleArrayExtra(GLGameActivity.UPDATE_TIMES);
            mRenderTimes = data.getDoubleArrayExtra(GLGameActivity.RENDER_TIMES);
        } else {
            setException(new Exception("Benchmark failed to run"));
        }
        // Release semiphore.
        mSemaphore.release();
        finish();
    }
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:16,代碼來源:GLReferenceActivity.java


注:本文中的android.content.Intent.getDoubleArrayExtra方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。