Tag Archives: android tutorial

Android Tabs with interacting map and list views

Last tutorial, we wrote a simple app that displays two interacting list views in a TabActivity. In this tutorial, we will up the ante and add a MapView as the content of one of the tabs. Why again are we using multiple views in an activity instead of using a separate activity for each tab content? Remember, we want our tabs to be able to easily interact with one another, and keeping them as views allows us to handle the logic and interaction within one activity.

So, our goal in this tutorial is to have a list of geo coordinates and when we click on an item in the list, our map view goes to that location.
Continue reading

Android TabActivity with two list views

Often times when creating an activity with tabs, it’s easy to have a separate activity for the tab content.  However, things get tricky when those activities need to interact with one another.

So the solution is to create a tabactivity with views (instead of activities) as the tab content.  We see a very simple example of this in the official Android tutorial Hello, TabWidget.

In this tutorial, we will create a slightly more advanced application.  We will have two listviews as the content of a tabactivity and have them interact with one another (basically by clicking the items of one list view will add them to the second list view). Continue reading