Challenge: ShareCompat

Your first challenge is an easy one. Android’s support library provides a class called ShareCompat, with an inner class called IntentBuilder. ShareCompat.IntentBuilder makes it a bit easier to build the exact kind of Intent you used for your report button.

So your first challenge is this: in mReportButton’s OnClickListener, use ShareCompat.IntentBuilder to build your Intent instead of doing it by hand.

Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition 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.