안녕하세요..
안드로이드펍에서 좋은정보 보면서 연습해보고 있는데요..
메인activity에서..버튼을 클릭하여
mapview로 넘어가는 방식으로 도전하고 있습니다..
현재 현상은 mapview화면으로 넘어가는데
타일만 보이고 지도는 나오지 않습니다..
api키는 디버그용으로 받아서 사용하고 있는데요..
우선 에뮬에서만 잘 동작하면 됩니다..
소스는 아래와같습니다..
보시고 도움 부탁드립니다..
main.java-------------------------------------------------------------------------------------------
Button button03 = (Button)findViewById(R.id.button03);
button03.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(main.this, MyMapActivity.class);
startActivity(i);
}
});
mymapactivity.java----------------------맵뷰부분입니다..
public class MyMapActivity extends MapActivity {
MapView mMap;
MapController mControl;
protected boolean isRouteDisplayed() {
return false;
}
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mymapactivity);
mMap = (MapView) findViewById(R.id.mapview);
mMap.setBuiltInZoomControls(true); //지도 확대/축소기능 활성화
mMap.setSatellite(false);
mControl = mMap.getController();
mControl.setZoom(16);
GeoPoint pt = new GeoPoint(37881311, 127729968);
mControl.setCenter(pt);
mMap.invalidate();
}
}
mymapactivity.xml------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="6dip">
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="05SCxTvBr-mY3lYyS1D3gWOHP0ZyKe01yVoI3IA"
/>
</RelativeLayout>
menifest.xml-----------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kr.MyProject01.MyApp01"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" >
<activity android:name=".main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".mymapactivity"
android:label="mymapactivity">
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>
이상입니다..
제가 안드로이드를 접한지 몇일되지않아 부탁드립니다..
수고하세요..



