2013-04-25 4 views
0

я в новых android.i нужны создать Google Map.i попытаться создать карту Google в эмуляторе С моего дискакак создать карту Google в андроиде

android-sdk-windows\add-ons\addon-google_apis-google-16\samples\MapsDemo

1) я добавил карту, эффект и USBS баночки файл в папке libs.
2) я добавил разрешение

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 

но пришел ошибка, код
ОШИБКА:

04-25 18:00:00.857: E/AndroidRuntime(2339): FATAL EXCEPTION: main 
04-25 18:00:00.857: E/AndroidRuntime(2339): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidmap/com.example.androidmap.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.androidmap/com.example.androidmap.MapsDemo}; have you declared this activity in your AndroidManifest.xml? 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.ActivityThread.access$600(ActivityThread.java:130) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.os.Handler.dispatchMessage(Handler.java:99) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.os.Looper.loop(Looper.java:137) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.ActivityThread.main(ActivityThread.java:4745) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at java.lang.reflect.Method.invokeNative(Native Method) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at java.lang.reflect.Method.invoke(Method.java:511) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at dalvik.system.NativeStart.main(Native Method) 
04-25 18:00:00.857: E/AndroidRuntime(2339): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.androidmap/com.example.androidmap.MapsDemo}; have you declared this activity in your AndroidManifest.xml? 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1541) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1416) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Activity.startActivityForResult(Activity.java:3351) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Activity.startActivityForResult(Activity.java:3312) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Activity.startActivity(Activity.java:3522) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Activity.startActivity(Activity.java:3490) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at com.example.androidmap.MainActivity.onCreate(MainActivity.java:14) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Activity.performCreate(Activity.java:5008) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 
04-25 18:00:00.857: E/AndroidRuntime(2339):  ... 11 more 

EDIT:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.androidmap" 
    android:versionCode="1" 
    android:versionName="1.0" > 
    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="17" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <uses-library android:name="com.google.android.maps" /> 
     <activity 
      android:name="com.example.androidmap.MainActivity" 
      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="com.example.android.apis.MapsDemo" android:label="MapsDemo"/> 
     <activity android:name="com.example.android.apis.view.MapViewDemo" android:label="MapView"/> 
     <activity android:name="com.example.android.apis.view.MapViewCompassDemo" android:label="MapView and Compass"/> 
      </application> 
</manifest> 

пожалуйста, помогите мне.

ответ

2

Вам нужно расширить класс с MapActivity и убедитесь, что у вас есть объявить его в Menifest.xml файл или по этой ссылке за помощью Google Maps

0

Вы не заявили о деятельности в вашем файле манифеста - добавить их. Для получения дополнительной информации о Google Maps API отметьте this

+0

Вы пишете код – AnilPatel

+0

, вы говорите, какую оставшуюся активность? – AnilPatel

Смежные вопросы