This year, I decided to participate in my company’s halloween contest. My Instagram news feed usually has a few cosplayers on there, and they started inspiring me to try and build a costume of my own. First I thought of dressing as Geralt from the Witcher, since I’m still in the middle of playing Witcher 3. All the sewing and fabric cutting got me a bit nervous though. Then I came across a video of a cosplayer showing how she built armour and she made it look SO easy!
Sometimes you want to modify some of the defaults that appear in the chooser, like when you’re sharing a text or image to any other android app that can accept text or images. The most common use case for this is when users press the “Share” button in your app. To create the custom chooser, you use the ShareCompat.IntentBuilder class. String title = "Share weather details"; String mimeType = "text/plain"; String shareText = "I want to share this string"; Intent intent = ShareCompat.
An image is worth a 1000 words. Source That image generally sums up the main beats of the Android Activity lifecycle. Knowing the lifecycle allows you to think about what your application should do as it goes through this lifecycle. What information you need to save to ensure the user has a consistent experience? I’d really like to see how Twitter handles the lifecycle on it’s timeline activity. I admire how well, even when the app crashes, it’s able to maintain the exact position I was in on my twitter feed.
Intents are a kind of messaging system used by Android activities to pass information back and forth. It helps keep a separation of concerns between activities. There are two main types of intents: explicit and implicit. Explicit intents are best used between activities within your own application, since they require the full class name in order for them to be started. Here’s an example of starting an explicit intent. This would appear in an Activity class: