Code example for Parcel

Methods: createStringArray, writeStringArray

0
    } 
 
    @Test 
    public void testWriteCreateStringArray() { 
      final String[] strings = { "foo", "bar" };
      parcel.writeStringArray(strings);
      final String[] strings2 = parcel.createStringArray();
      assertTrue(Arrays.equals(strings, strings2));
    } 
 
    @Test 
    public void testReadWriteStringList() { 
        final List<String> strings = Arrays.asList( "foo", "bar" );
        parcel.writeStringList(strings);
        List<String> extractedStrings = new ArrayList<String>();
        parcel.readStringList(extractedStrings);
        assertEquals(strings, extractedStrings);
    } 
 
    @Test 
    public void testWriteCreateStringArrayList() {