0
私は、Androidに新たなんだと、私はこの記事のようなのMapView上のタッチ Google Maps Android API v2 - detect touch on mapどのようにアンドロイドにGoogleマップのタッチイベントを処理するために(断片内)
を処理したいしかし、それはかなり違い、私の例では、Iフラグメントクラスを使用してすべてのマップビジネスを処理します。
マイレイアウト:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/buttonTracking"
... />
</LinearLayout>
私はすでにsetOnTouchListenerを使用しようとしているが、それは
public class MapsFragment extends Fragment implements PermissionsFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ll = (LinearLayout) inflater.inflate(R.layout.fragment_maps, container, false);
mMapView = (MapView) ll.findViewById(R.id.map);
ll.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event){
Log.e("INFO", "Touched");
return true;
}
});
}
}
私はanythingsを欠場動作しませんか?助けてください! Googleマップのおかげで
clickListenerは、ユーザーのアクションを検出するために十分ではありませんではないオブジェクト。私はユーザードラッグマップを検出したい。この問題を解決するために、 'setOnCameraMoveStartedListener'を理由= 'REASON_GESTURE'で使用しています。 –