안드로이드 개발 질문/답변
(글 수 45,052)
mapview(맵뷰)화면에서 context menu(컨텍스트메뉴)를 사용하려면 어떻해야하나요?
현재
private MapView mapview;
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.map_layout);
initMapView();
initMyLocation();
registerForContextMenu(mapview); << 이 부분이 컨텍스트 메뉴
}
private void initMapView() {
mapview = (MapView) findViewById(R.id.mapview);
controller = mapview.getController();
mapview.setSatellite(false);
mapview.setBuiltInZoomControls(true);
}
이런식으로 해서 만들엇는데 맵에서 컨텍스트 메뉴가 안뜨는데,,
어떻게해야하나요?ㅠㅠ
현재
private MapView mapview;
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.map_layout);
initMapView();
initMyLocation();
registerForContextMenu(mapview); << 이 부분이 컨텍스트 메뉴
}
private void initMapView() {
mapview = (MapView) findViewById(R.id.mapview);
controller = mapview.getController();
mapview.setSatellite(false);
mapview.setBuiltInZoomControls(true);
}
이런식으로 해서 만들엇는데 맵에서 컨텍스트 메뉴가 안뜨는데,,
어떻게해야하나요?ㅠㅠ
activity를 상속받은 클래스에서 맵뷰 클래스를 생성할때 this로 인자를 넘기고... 사용하시면 되죠...