onTouchイベントを使用したい(マップ上のオブジェクトの回転ジェスチャを処理するため)。mainActivityのActivityを拡張し、フラグメントを使用してそれを行うことはできません。だから私はMapViewクラスを使うべきだと思います。新しいバージョンのグーグルマップアンドロイド(V2)でこれを行うにはどうすればよいですか?これは何も表示しません。電話のみの空白の白い画面。
MainActivity:
public class MainActivity extends Activity {
// MapView mapV;
// GoogleMap map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mapV = ((MapView) findViewById(R.id.map));
map = mapV.getMap();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
activity_main.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"
tools:context=".MainActivity" >
<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>