user1659006
user1659006

Reputation: 373

Is it possible to show a mapView in a dialog in Android?

Here is my code:

    Dialog dialog = new Dialog(this);
    dialog.setContentView(R.layout.show_info_with_map);
    dialog.setTitle(title);
    dialog.setCancelable(true);
    dialog.show();

show_info_with_map is a layout file with a maoView and some textView. I did added the user-library and extended MapActivty. But I am still getting the following error:

E/AndroidRuntime(23846): android.view.InflateException:

Binary XML file line #108: Error inflating class com.google.android.maps.MapView

Upvotes: 0

Views: 1274

Answers (2)

K_Anas
K_Anas

Reputation: 31466

Absolutely! Add android:theme="@android:style/Theme.Dialog" to your 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

Upvotes: 3

Andrii Chernenko
Andrii Chernenko

Reputation: 10204

Show your MapView in MapActivity, just make it look like dialog by applying Theme.Dialog to it.

There's no other way. At least with API v1. You can also take a look at Maps API V2

Upvotes: 0

Related Questions