Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网}
return super.onMenuItemSelected(featureId, item);
}
@Override
protected void onResume()
{
// TODO Auto-generated method stub
super.onResume();
}
@Override
protected void onPause()
{
// TODO Auto-generated method stub
super.onPause();
}
@Override
protected void onDestroy()
{
// TODO Auto-generated method stub
if(dbHelper!=null &&
dbHelper.getReadableDatabase().isOpen())
{
dbHelper.close();
}
super.onDestroy();
}
}
4。在Map上画图
Java代码
package irdc.ex10_06;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import android.database.Cursor;
import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
public class EX10_06_04 extends MapActivity{
private TextView mTextView01;
/* 独一无二的menu选项identifier,用以识别事件 */
static final private int MENU_ADD = Menu.FIRST;
static final private int MENU_EDIT = Menu.FIRST+1;
static final private int MENU_DRAW = Menu.FIRST+2;
/* Google地图所需成员变量 */
private MapView mMapView01;
private int intZoomLevel=20;
/* 数据库所需成员变量 */
更多精彩
赞助商链接