MapView/Activity Touch problems

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

MapView/Activity Touch problems

Postby Davide » Mon Sep 06, 2010 9:50 am

I'm developig an app with a MapActivity, the problem withi it is that it's react in a crazy way when I touch the map.
If I touch the map and keep my finger on it without moving it, the map randomly zoom in, zoom out, move somewhere, the edittext above the map keep and loose focus, sometimes happen that the app close itself and the icons on the desktop auto click theirselves...
As anybody encountered this problem and maybe knows how to avoid it?
On the emulator doesn't happen.
I'm targetting 1.5 SDK + Google API.

This is the layout xml (I changed the api key).

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent" android:layout_height="fill_parent"
   android:orientation="vertical">
   <TextView android:layout_height="wrap_content"
      android:background="@drawable/tab" android:layout_width="fill_parent"
      android:gravity="center_vertical|center_horizontal" android:id="@+id/TextViewNewsListTitle"
      android:textColor="@android:color/white" android:text="@string/title_search"></TextView>

   <LinearLayout android:id="@+id/LinearLayoutMapControl"
      android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal"><ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/target" android:id="@+id/ImageButtonMapTarget" android:background="@drawable/btn_default"></ImageButton><EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/EditTextMap" android:maxLines="1" android:imeOptions="actionDone"></EditText>

<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/search_b" android:id="@+id/ImageButtonMapSearch" android:background="@drawable/btn_default"></ImageButton>
</LinearLayout>
   
<com.google.android.maps.MapView android:id="@+id/MapView" android:layout_height="fill_parent" android:layout_width="fill_parent" android:clickable="true"
   android:apiKey="*******************************"/><LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/LinearLayoutZoom"></LinearLayout>


</LinearLayout>

Davide
Experienced Developer
Experienced Developer
 
Posts: 69
Joined: Mon Oct 19, 2009 12:05 pm
Location: Italy

Top

Re: MapView/Activity Touch problems

Postby Davide » Mon Sep 06, 2010 10:15 am

I think to have resolved it... On the onTap method in the ItemOverlay class I always returned true, now I put some conditions and return false otherwise and it seems to work....

EDIT. No it wasn't the tap method... :(

Ri-EDIT: I just unplugged the device from the PC and it goes as it has to do. So it's all ok.
Davide
Experienced Developer
Experienced Developer
 
Posts: 69
Joined: Mon Oct 19, 2009 12:05 pm
Location: Italy

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests