404 CHAPTER 11: Digital Video: Streaming Video, MediaPlayer, and MediaController classes
Create a PlayVideo.java Activity Subclass
Let’s use an optimal work process where we have Eclipse create a new PlayVideo.java Activity
subclass for us, by continuing on with installing your OptionsMenu object. We need to add in a
switch-case statement structure for the new second MenuItem object, which you just installed in
your /res/menu/main.xml folder and file in the previous section of this chapter.
- The easiest way to accomplish this is to open up your MainActivity.java
class, as shown in Figure 11-3, copy and paste your edit_galaxy switch-case
statement, from case through break, underneath itself.Change the edit_galaxy
to play_video and change the edit Intent to playIntent.
Figure 11-2. Add a MenuItem object using an