Recipe Adding Views to a

The developer can add any View or ViewGroup to the MapView.This recipe shows the addition of two simple elements to a map: TextView and Button.When the button is clicked, the text in the TextView changes. These two views are added to MapView by calling the addView() method with LayoutParams. Here, the location of the elements are specified in (x,y) screen coordinates, but developers can also provide a GeoPoint to the LayoutParams instead. Listing 10.13 shows the main activity, which also requires the MyMarkerLayer class defined in the previous recipe (Listing 10.11 with the first line changed to reflect the proper package).This results in the map view shown in Figure 10.6.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook

Post a comment