Code example for List

Methods: get, size

0
        Bitmap bitmap = Bitmap.createBitmap(20, 20, Bitmap.Config.ALPHA_8);
 
        builder.setImageAttachmentsForAction(Arrays.asList(bitmap));
 
        List<JSONObject> images = action.getImage();
        assertNotNull(images);
        assertTrue(images.size() == 1);
 
        List<String> attachmentNames = builder.getImageAttachmentNames();
        assertNotNull(attachmentNames);
        assertTrue(attachmentNames.size() == 1);
 
        String attachmentName = getAttachmentNameFromContentUri(images.get(0).getString("url"));
        assertEquals(attachmentNames.get(0), attachmentName);
    } 
 
    public void testCantSetObjectAttachmentsWithoutAction() { 
        try { 
            FacebookDialog.OpenGraphActionDialogBuilder builder =
                    new FacebookDialog.OpenGraphActionDialogBuilder(getActivity(), null, "foo", "foo"); 
            builder.setImageAttachmentsForObject("foo", new ArrayList<Bitmap>());