CHAPTER 11: Digital Video: Streaming Video, MediaPlayer, and MediaController classes 413
- Name the VideoView videoPlayer since that is what it is, and then mouse-over
the wavy red error highlight and select the Import ‘VideoView’ (android.widget)
option to have Eclipse write the VideoView import statement. - Next, you need to instantiate the videoPlayer VideoView object using the
findViewById( ) method call and then reference to the activity_play.xml UI
definition file that you just created inside of that method call, as shown in
Figure 11-10. Once you’ve done this, you will be able to call methods off this
videoPlayer VideoView object.
Figure 11-9. Declare the VideoView object, name it videoPlayer, then mouse-over the error highlight and import the class
Figure 11-10. Instantiate the videoPlayer VideoView object the using findViewById( ) method referencing the videoPlayer ID