A (175)

(Tuis.) #1

534 CHAPTER 14: Android Content Providers: Providing Data to Applications


Inside the onClick( ) method, you are going to use the Activity class’s .finish( ) method call. What this
method call does, if your Activity was called from another Activity using an Intent object, is return
you to that original Activity! See Figure 14-24.


Figure 14-24. Add an unimplemented method and replace the comment with a call to the Activity class’s .finish( ) method


For now, you will use the .finish( ) method in all of the event handling methods, as seen in Figure 1 4-2 5.
I’m doing this so there is functional code in the Button UI constructs, which will allow you to put all
the Button event handling constructs into place. Then you can replace the .finish( ) method call with
the database access programming logic as you implement the listButton through the spiralButton.
This is a pretty cool coding trick!


Figure 14-25. Copy and paste a listButton construct four times underneath itself to create the other four Button objects

Free download pdf