From the course: Advanced Android Espresso Testing
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Incoming intents: Unknown theme - Android Tutorial
From the course: Advanced Android Espresso Testing
Incoming intents: Unknown theme
- [Instructor] What happens if we launched Ideas Activity with a theme that it doesn't know. Let's try that. Copy and paste the test message Punny. Rename it to Unknown. On line 44, instead of loading the string from resource we are going to hot code the value Silly. We will create the intent and pass it to launch activity the same way so you can keep lines 46 through 48. However, we are not expecting the theme Silly to be displayed in the text view theme because it is not a known theme. Let's go back to the activity and see what it does. Press command shift-T to jump back to Ideas Activity. Scroll to the place where we are handling the theme. On line 39, if you click on it so that it is not in-lining the string, you can see the code. We are parting the string a known theme and passing it a theme. Come on click on a known theme and you can see that it has a place holder, percent one dollar S. That is why we need to pass in the theme so that we can do something with it in the place…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
App: Cat Names1m 28s
-
How intents are used5m 6s
-
Incoming intents: Empty4m 20s
-
Incoming intents: Activity rule2m 45s
-
Incoming intents: Known theme2m 19s
-
Incoming intents: Loading string2m 25s
-
Incoming intents: Unknown theme4m 34s
-
Outgoing intents: Launch activity4m 14s
-
Outgoing intents: Verify intent5m 1s
-
Outgoing intents: How to match?5m 5s
-
Stubbing: Intending1m 16s
-
Stubbing: ActivityResult4m 52s
-
-
-
-