1

hi im wanting to know how to add google maps into a list view? i have tried it by adding into my list but i get an error that says it needs to be in a MapsActivity but my Activity already extends ListActivity is there a way i can extend multiple activities? or does anyone know how to implement google maps within a list view?

1
  • Why do you want to add a map to a list view in the first place? Are you sure you really need that? How many maps will want to have? Commented Jun 24, 2012 at 11:26

1 Answer 1

2

Java doesn't allow multi inheritance. Therefor if you need a MapActivity you can't extend the ListActivity as weel. So you want to have a listView defined on the XML.

Add a list view to your xml file:

<ListView android:id="+@id/myListView" android:layout_width="fill_parent" android:layout_height="wrap_content"> </ListView> 

And then reference it on the activity to make your logic:

 Listview lv = (ListView) findviewById(R.id.myListView); lv........... 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.