【发布时间】:2015-03-28 20:09:13
【问题描述】:
所以最终我不得不回到这里再次询问。我在这个问题上搜索了很多。有很多解决方案,它们非常令人困惑。而且,大部分都是在Eclipse中完成的,他们说要改变路径,用eclipse和bla bla结合它......
问题描述:
在我的应用程序中(在 android studio 中),我有一个名为 Map view 的项目,我希望一旦用户点击它,它应该会进入一个地图视图页面并找到该地址(我在我的代码中提到过)在地图中。我怎么能这样做?
虚拟内容:
................................
................................
static {
// Add 4 sample items.
addItem(new DummyItem("1", "Shopping center details"));
addItem(new DummyItem("2", "Homepage"));
addItem(new DummyItem("3", "Contact"));
addItem(new DummyItem("4", "Map View"));
}
.................................
..............................
ItemDetailFragment:
.................
....................
}else if(mItem.equals("4")){//4. Map View
/*locate the following address in google map:
Times Square
Manhattan, NY 10036
United States
*/
rootView = inflater.inflate(R.layout.fragment_map_detailed, container, false);
WebView webview = (WebView) rootView.findViewById(R.id.webView2);
webview.setWebViewClient(new WebViewClient());
}
..............................
......................
fragment_map_detailed.XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
</LinearLayout>
【问题讨论】:
标签: android android-layout google-maps-android-api-2 android-mapview android-maps-v2