Googlemap inside a custom dialog - android

Do anyone know if this is possible? I have a custom dialog box that contains a viewflipper. The first view is a linearlayout with some records. I wanted the second view to be the google maps with the same records but this time location based.
Since the mapview needs to extend mapactivity, and the activity that calls the dialog is already set up, I's starting to think it's not possible.

Absolutely! When I add android:theme="#android:style/Theme.Dialog" to my map activity in the manifest, it comes up as a dialog. You can then control how the dialog appears by tweaking your map activity layout.

Related

How to zoom map fragment in seperate alert dialog on click

In my application i am using 5 fragments, one fragment contains map. As per size limitation i cannot show all pin with zoom level 15 with marker.
So i want to display a bigger version of map fragment in side a alert box once use click on map fragment similar to this
How i can achieve this. Any help will be appreciated. Thanks in advance.
You have several approaches you can use.
1) use an activity with dialog theme
2) jsut declare a floating FrameLayout inside your main layout and add a MapFragment to it.

Embedding Map Activity in another activity in Android

I would like to make the google maps viewable in another activity, that is, it does not take the entire screen. Is it possible to embed a google map map activty in another activity, so that, let's say, it takes half or 3/4 of the screen please?
Thanks in advance!
Try this:
http://mobiforge.com/developing/story/using-google-maps-android
You can use MapView as any other view - position and size as you like.
If you want to place MapView into ScrollView here is good solution to make sure it works correctly: MapView inside a ScrollView?
You can include MapView in layout and code for the same in MapActivity with the portion you want for it.
Why do you want for it in another activity?

Is there any modeless dialog in android, like what google maps shows when touched?

I want a widget that can interact with user, but will not block the activity ,just like google maps does when some place in the screen is touched.
Did any body know how to implement it?
I already know toast、alert,even activity with dialog theme ,seems that they all not meet my request.
Many thanks.
I believe these are built using the PopupWindow class.

Maps Activity single mapview

I have a map views which is have some markers on the map and a back button to the main page.
I also have a list of textview which is when selected, it will open a new page that have a button "View Map". The button "view map" will open up a map.
Each selected page has different map view which is different markers on it.
The problem is :
It works fine when I select the list of textview and "view map" button. The button back also functioning well. However, when i select another list and click the button view map, debug force close appear. I look for the solutions and the DDMS shows that "you are only allowed to have a single mapview in a mapactivity". How i'm going to fix this problem with the simpler ways without create another class or create new activity in android manifest.?
Refactor your map activity in a way so you can pass a bunch of data to it which will contain the information about the locations to be displayed. By doing this you can mark different sets of places on you map dynamically. For this you can either use on Overlay class in you map activity or for each set of markers an own Overlay class.
This should made it possible to use one MapView multiple times.
Another thing you should avoid is displaying a back button. Normally you don't need one as every Android device has a back button by design. So another back button might confuse your users.

How do you create a Google Maps-esque drop down dialog?

In the Google Maps application, when you open the menu and click on "Directions", it pops up a dialog that is unique to Google Maps. It keeps the MapView in the background, but displays the search dialog from the top (or bottom, if you're on an old version of Android).
I was curious if anyone knew how they achieved this effect. I'm willing to create a custom Dialog, but it seems that Dialogs are designed to pop into the middle of the screen (any other types of dialogs are denied permission as system dialogs). What trick is Google Maps using?
Just make your activity's root layout a FrameLayout or RelativeLayout (so your new view can overlap what's on screen). Then just add a layout with whatever you want as a child of that root layout (say, by inflating your desired dialog's XML into it when a button is clicked somewhere, either manually or using a ViewStub), and define a LayoutAnimation on the child before showing it.
For more on LayoutAnimations check out the API Demos app that ships with the Android SDK.

Categories

Resources