本文整理汇总了Java中com.amap.api.maps2d.MapView.onCreate方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.onCreate方法的具体用法?Java MapView.onCreate怎么用?Java MapView.onCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amap.api.maps2d.MapView
的用法示例。
在下文中一共展示了MapView.onCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter filter = new IntentFilter();
filter.addAction(DJIDemoApplication.FLAG_CONNECTION_CHANGE);
registerReceiver(mReceiver, filter);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
initMapView();
initUI();
addListener();
}
示例2: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_searchlocation);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 必须要写
Intent intent = getIntent();
keyWord = intent.getStringExtra("keyWord");
city = intent.getStringExtra("city");
pz = intent.getIntExtra("count", 1);
if (TextUtils.isEmpty(keyWord)) {
keyWord = "中科汇联信息技术有限公司";
}
if (TextUtils.isEmpty(city)) {
city = "北京";
}
init();
}
示例3: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_locationplusmap);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 必须要写
Intent intent = getIntent();
keyWord = intent.getStringExtra("keyWord");
city = intent.getStringExtra("city");
pz = intent.getIntExtra("count", 1);
if (TextUtils.isEmpty(keyWord)) {
keyWord = "中科汇联信息技术有限公司";
}
if (TextUtils.isEmpty(city)) {
city = "北京";
}
initId();
init();
}
示例4: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// When the compile and target version is higher than 22, please request the
// following permissions at runtime to ensure the
// SDK work well.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.VIBRATE,
Manifest.permission.INTERNET, Manifest.permission.ACCESS_WIFI_STATE,
Manifest.permission.WAKE_LOCK, Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.CHANGE_WIFI_STATE, Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS,
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.SYSTEM_ALERT_WINDOW,
Manifest.permission.READ_PHONE_STATE,
}
, 1);
}
setContentView(R.layout.activity_way_point);
IntentFilter filter = new IntentFilter();
filter.addAction(DJIDemoApplication.FLAG_CONNECTION_CHANGE);
registerReceiver(mReceiver, filter);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
initMapView();
initUI();
addListener();
}
示例5: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_view_amap_layout);
mapView = (MapView) findViewById(R.id.autonavi_mapView);
mapView.onCreate(savedInstanceState);// 此方法必须重写
ToolBarOptions options = new ToolBarOptions();
setToolBar(R.id.toolbar, options);
initView();
initAmap();
initLocation();
updateSendStatus();
}
示例6: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_view_amap_navigation_layout);
mapView = (MapView) findViewById(R.id.autonavi_mapView);
mapView.onCreate(savedInstanceState);// 此方法必须重写
ToolBarOptions options = new ToolBarOptions();
setToolBar(R.id.toolbar, options);
initView();
initAmap();
initLocation();
updateSendStatus();
}
示例7: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.find_around_layout);
mapView = (MapView) findViewById(R.id.map); //显示地图
mapView.onCreate(savedInstanceState); //必须要写
aMap = mapView.getMap(); //获取地图对象
initViews();
EventDeal();
}
示例8: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMapView=(MapView)findViewById(R.id.primary_map);
city_btn =(Button)findViewById(R.id.city_name);
main_content =(TextView)findViewById(R.id.main_content);
mMapView.onCreate(savedInstanceState);
init();
}
示例9: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_share_location);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 此方法必须重写
init();
}
示例10: onCreateView
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main_map_layout, container, false);
//显示地图
mapView = (MapView) rootView.findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
aMap = mapView.getMap();
initMap();
//跳转至发帖页
publishButton = (FloatingActionButton) rootView.findViewById(R.id.main_map_publish_button);
publishButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!LoginStatus.getIsUserMode()) {
GreenToast.makeText(getActivity(), getResources().getString(R.string.please_login_first), Toast.LENGTH_LONG).show();
return;
} else if (CommonUtil.isEmptyString(LocationInfo.getAddress()) ||
CommonUtil.isEmptyString(LocationInfo.getCityName()) ||
CommonUtil.isEmptyString(String.valueOf(LocationInfo.getLat()))) {
GreenToast.makeText(getActivity(), getResources().getString(R.string.can_not_get_your_location), Toast.LENGTH_LONG).show();
return;
}
getActivity().startActivityForResult(new Intent(getActivity(), PublishActivity.class), IntentUtil.TO_PUBLISH_PAGE);
}
});
return rootView;
}
示例11: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_simple);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 必须要写
}
示例12: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_locationmap);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 必须要写
initId();
init();
}
示例13: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_content_activity);
setActionbar();
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState); // 此方法必须重写
int index = this.getIntent().getExtras().getInt("INDEX");
Log.i(TAG, "------->index:"+index);
setContent();
}
示例14: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gaode_map);
mapView = (MapView) findViewById(R.id.map);
LogHelper.e("gaode", "create");
mapView.onCreate(savedInstanceState);// 必须要写 init();
init();
LogHelper.e("gaode", "init");
container = findViewById(R.id.container);
findViewById(R.id.mark_tv).setVisibility(View.GONE);
if (!readIntent()) {
LogHelper.e("gaode", "select");
getSupportActionBar().setCustomView(R.layout.ct_action_search);
getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().collapseActionView();
SearchView searchView = (SearchView) getSupportActionBar().getCustomView().findViewById(R.id.search_view);
searchView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
searchView.onActionViewCollapsed();
getSupportActionBar().getCustomView().findViewById(R.id.confirm).setVisibility(View.GONE);
getSupportActionBar().getCustomView().findViewById(R.id.confirm).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
queryAndSave(currentItem.getLatLonPoint().getLatitude(),
currentItem.getLatLonPoint().getLongitude(),
currentItem.getTitle()
);
}
});
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
public boolean onQueryTextSubmit(String query) {
search(query);
return true;
}
public boolean onQueryTextChange(String newText) {
return true;
}
});
move(25.044061, 121.510841);
} else {
LogHelper.e("gaode", "show");
mapView.postDelayed(new Runnable() {
@Override
public void run() {
moveAndMark(lat, lng, name);
}
}, 300);
LogHelper.e("gaode", "show ok");
}
getSupportActionBar().show();
supportInvalidateOptionsMenu();
LogHelper.e("gaode", "done");
}
示例15: onCreate
import com.amap.api.maps2d.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_locationandapois);
System.out.println("打开 five");
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 必须要写
Intent intent = getIntent();
ArrayList<PoiItem> pois = intent.getParcelableArrayListExtra("apois");
lp = intent.getParcelableExtra("lp");
String title = intent.getStringExtra("title");
if (!TextUtils.isEmpty(title))
((TextView) findViewById(R.id.tv_title)).setText(title);
initAmap();
if (pois != null && pois.size() > 0) {
aMap.clear();// 清理之前的图标
poiOverlay = new PoiOverlay(aMap, pois);
poiOverlay.removeFromMap();
poiOverlay.addToMap();
poiOverlay.zoomToSpan();
aMap.setOnMarkerClickListener(this);
poiItem = pois.get(0);
}
if (lp != null) {
MarkerOptions mo = new MarkerOptions();
mo.title("我的位置");
mo.position(new LatLng(lp.getLatitude(), lp.getLongitude()));
mo.icon(BitmapDescriptorFactory.fromResource(R.drawable.location_marker));
aMap.addMarker(mo);
}
//TODO 找路线
findViewById(R.id.btn_route).setOnClickListener(this);
findViewById(R.id.ib_back).setOnClickListener(this);
}