Bundle getFloatArray - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle getFloatArray method.

This code example shows how to use the following methods:containsKey, getFloat, getFloatArray, getParcelable
 
	@Override 
	protected void onRestoreInstanceState(Parcelable state) {
		Bundle savedState = (Bundle) state;
 
		Parcelable superState = savedState.getParcelable(STATE_PARENT);
		super.onRestoreInstanceState(superState);
 
		setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
		if (savedState.containsKey(STATE_SATURATION)) {
			setSaturation(savedState.getFloat(STATE_SATURATION));
		} else { 
			setValue(savedState.getFloat(STATE_VALUE));
		} 
	} 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFloat, getFloatArray, getParcelable
 
	@Override 
	protected void onRestoreInstanceState(Parcelable state) {
		Bundle savedState = (Bundle) state;
 
		Parcelable superState = savedState.getParcelable(STATE_PARENT);
		super.onRestoreInstanceState(superState);
 
		setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
		setValue(savedState.getFloat(STATE_VALUE));
	} 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:containsKey, getFloatArray
 
    public static float[] getConfidenceFromDirect(Bundle bundle)
    { 
        float [] scores = null;
        if ((bundle != null)
                && bundle.containsKey(SpeechRecognizer.RESULTS_RECOGNITION))
        { 
            scores =
                bundle.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES);
        } 
        return scores;
    } 
 
    public static List<String> getHeardFromDirectPartial(Bundle bundle)
    { 
        List<String> results = new ArrayList<String>();
        if (bundle.containsKey(UNSUPPORTED_GOOGLE_RESULTS))
        { 
            String [] resultsArray =
                bundle.getStringArray(UNSUPPORTED_GOOGLE_RESULTS);

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFloat, getFloatArray, getParcelable
 
	@Override 
	protected void onRestoreInstanceState(Parcelable state) {
		Bundle savedState = (Bundle) state;
 
		Parcelable superState = savedState.getParcelable(STATE_PARENT);
		super.onRestoreInstanceState(superState);
 
		setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
		setSaturation(savedState.getFloat(STATE_SATURATION));
	} 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getBundle, getFloatArray
    } 
 
    @Override 
    protected void onRestoreInstanceState(Parcelable p) {
        Bundle b = (Bundle) p;
        super.onRestoreInstanceState(b.getBundle("super"));
        mLevels = b.getFloatArray("levels");
    } 
 
    @Override 
    protected void onAttachedToWindow() { 
        super.onAttachedToWindow(); 
 
        setLayerType(View.LAYER_TYPE_HARDWARE, null);
        buildLayer();
    } 
 
    /** 
     * Returns a color that is assumed to be blended against black background, 
     * assuming close to sRGB behavior of screen (gamma 2.2 approximation). 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFloatArray, getInt, getParcelable
 
	@Override 
	protected void onRestoreInstanceState(Parcelable state) {
		Bundle savedState = (Bundle) state;
 
		Parcelable superState = savedState.getParcelable(STATE_PARENT);
		super.onRestoreInstanceState(superState);
 
		setColor(Color.HSVToColor(savedState.getFloatArray(STATE_COLOR)));
		setOpacity(savedState.getInt(STATE_OPACITY));
	} 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getBoolean, getBooleanArray, getChar, getCharArray, getDouble
        assertEquals(Float.valueOf(7), Float.valueOf(bundle.getFloat("bar", 7)));
    } 
 
    @Test 
    public void testGetOfWrongType() { 
        bundle.putFloat("foo", 5f);
        assertEquals(0, bundle.getChar("foo"));
        assertEquals(null, bundle.getCharArray("foo"));
        assertEquals(0, bundle.getInt("foo"));
        assertEquals(null, bundle.getIntArray("foo"));
        assertEquals(null, bundle.getIntegerArrayList("foo"));
        assertEquals(0, bundle.getShort("foo"));
        assertEquals(null, bundle.getShortArray("foo"));
        assertEquals(false, bundle.getBoolean("foo"));
        assertEquals(null, bundle.getBooleanArray("foo"));
        assertEquals(0, bundle.getLong("foo"));
        assertEquals(null, bundle.getLongArray("foo"));
        assertEquals(null, bundle.getFloatArray("foo"));
        assertEquals(0, bundle.getDouble("foo"), 0.005);
        assertEquals(null, bundle.getDoubleArray("foo"));

0
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getBoolean, getBooleanArray, getChar, getCharArray, getDouble
    assertEquals(Float.valueOf(7), Float.valueOf(bundle.getFloat("bar", 7)));
  } 
 
  @Test 
  public void testGetOfWrongType() { 
    bundle.putFloat("foo", 5f);
    assertEquals(0, bundle.getChar("foo"));
    assertEquals(null, bundle.getCharArray("foo"));
    assertEquals(0, bundle.getInt("foo"));
    assertEquals(null, bundle.getIntArray("foo"));
    assertEquals(null, bundle.getIntegerArrayList("foo"));
    assertEquals(0, bundle.getShort("foo"));
    assertEquals(null, bundle.getShortArray("foo"));
    assertEquals(false, bundle.getBoolean("foo"));
    assertEquals(null, bundle.getBooleanArray("foo"));
    assertEquals(0, bundle.getLong("foo"));
    assertEquals(null, bundle.getLongArray("foo"));
    assertEquals(null, bundle.getFloatArray("foo"));
    assertEquals(0, bundle.getDouble("foo"), 0.005);
    assertEquals(null, bundle.getDoubleArray("foo"));

0
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Bundle getFloatArray Questions & Answers:

getFloatArray Method Overview
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
See Code Examples for other Android Bundle Methods: