Hi.
I'm so sorry for my code to confuse all of you.
This is the shortest sample.
/* BEGIN ------------------------------------------*/
/*------ ZoomControlMapSample.java -------*/
public class ZoomControlMapSample extends MapActivity {
private static final String API_KEY = "mapapikey";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MapView zmv = new ZoomMapView(this, API_KEY);
setContentView(zmv);
}
@Override
protected boolean isRouteDisplayed() { return false; }
}
/*------ ZoomMapView.java -------*/
public class ZoomMapView extends MapView implements
OnLongClickListener {
private static final int FILL = ViewGroup.LayoutParams.FILL_PARENT;
public ZoomMapView(Context context, String apiKey) {
super(context, apiKey);
// long click settings.
setClickable(true);
setLongClickable(true);
setOnLongClickListener(this);
// ZoomControls settings.
ZoomControls zoomControls = (ZoomControls) getZoomControls();
zoomControls.setLayoutParams(new ViewGroup.LayoutParams(FILL,
FILL));
zoomControls.setGravity(Gravity.BOTTOM +
Gravity.CENTER_HORIZONTAL);
addView(zoomControls);
}
// OnLongClickListener interface method
public boolean onLongClick(View arg0) {
displayZoomControls(true);
return false;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
onTouchEvent(ev);
return false;
}
}
/*------ AndroidManifest.java -------*/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adamrocker.android.sample.map.zoom">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".ZoomControlMapSample"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
/*------------------------------------------ END */
These are the all files except the R.java.
Thank you, jokochi. Your advice is useful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---