Code example for List

Methods: get, size

0
        Bitmap bitmap = Bitmap.createBitmap(20, 20, Bitmap.Config.ALPHA_8);
 
        builder.setImageAttachmentsForObject("foo", Arrays.asList(bitmap));
 
        List<GraphObject> images = object.getImage();
        assertNotNull(images);
        assertTrue(images.size() == 1);
 
        List<String> attachmentNames = builder.getImageAttachmentNames();
        assertNotNull(attachmentNames);
        assertTrue(attachmentNames.size() == 1);
 
        String attachmentName = getAttachmentNameFromContentUri((String) images.get(0).getProperty("url"));
        assertEquals(attachmentNames.get(0), attachmentName);
    } 
 
    public void testOpenGraphActionAndObjectImageAttachments() throws JSONException { 
        OpenGraphAction action = OpenGraphAction.Factory.createForPost();
        OpenGraphObject object = OpenGraphObject.Factory.createForPost("bar");
        action.setProperty("foo", object);