Creating the Attachment Pager Fragment

Now that you've assembled all of the parts required for the attachments to be created and previewed, you need to actually populate the area where they will be previewed. The AttachmentPagerFragment class will not only serve to encapsulate the ViewPager used to preview the attachments, but will also encapsulate the logic required to add new attachments to the user's claim. This will be done by moving the onRequestPermissionsResult and onActivityResult from the CaptureClaimActivity to the new AttachmentPagerFragment class. This process will require moving some of the code out of CaptureClaimActivity and into the Fragment class, so you'll be in for some cutting and pasting. Let's get started:

  1. Create a ...

Get Hands-On Android UI Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.