Code example for Intent

Methods: getExtrasputExtra, getFloatExtra

        assertEquals(2d, intent.getDoubleExtra("foo", -1));
    public void testFloatExtra() throws Exception { 
        Intent intent = new Intent();
        assertSame(intent, intent.putExtra("foo", 2f));
        assertEquals(2f, intent.getExtras().get("foo"));
        assertEquals(2f, intent.getFloatExtra("foo", -1));
    public void testIntArrayExtra() throws Exception { 
        Intent intent = new Intent();
        int[] array = new int[2];
        array[0] = 1;
        array[1] = 2;
        assertSame(intent, intent.putExtra("foo", array));
        assertEquals(1, intent.getIntArrayExtra("foo")[0]);
        assertEquals(2, intent.getIntArrayExtra("foo")[1]);
Connect your IDE to all the code out there  Get Codota for Java