【发布时间】:2013-07-27 05:58:51
【问题描述】:
setContentView() 在下面给出错误是我的代码:
public class LocateUserInMap extends FragmentActivity {
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_locate_user_in_map);
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
final LatLng CIU = new LatLng(19.111693900000000000,72.911271500000000000);
mMap.addMarker(new MarkerOptions().position(CIU).title("Friend"));
// findDirections(19.111693900000000000,72.911271500000000000,19.128203900000000000,72.928065000000060000, GMapV2Direction.MODE_DRIVING);
}
}
错误:
这是我正在使用的库:
和activity_locate_user_in_map.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".LocateUserInMap" >
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
</RelativeLayout>
我错过了什么... 请帮忙!!!
问候,
苏拉布
【问题讨论】:
-
发布activity_locate_user_in_map.xml
-
该应用程序似乎找不到 R.layout.activity_locate_user_in_map
-
@user2376920 你有解决方案吗?
-
不...到目前为止还没有任何效果。
-
清理项目无效。而且 maps.jar 在 GoogleAPI 中,我应该将其更改为 AndroidAPI 吗?