• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Mapview

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a dashboard for my android application. All the activities related to the dashboard feature extend from one base activity class. I have several features within the dashboard. GPS/ Maps is one of them. If user clicks maps I would like to display map with current latitude and longitude. In order to implement map it needs to extend the MapActivity class. In this case the GPS / Maps is already extending the base activity class. Since Java does not support multiple inheritance, how should handle this case? Can anybody provide some help? Or is there any other way to use maps in the application?

Thanks,
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since those are two different Activities, why couldn't they extend two different base classes?

Besides, to show a map, I don't think you need to extend MapActivity - you can just keep a MapView in your layout.
 
Akil Kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I use the map view then I need to choose the target as google API's instead of android while running the application. But for my application I need the target AVD as android. My question is how can I display map with the target set to android?

Thanks,
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic