これは機能せず、以下に示すように cat のログにエラーが表示されるため、何が間違っていたのかわかりません。さまざまなコードで試しましたが、それでもこのエラーが発生します。誰かがこのエラーで私を助けてくれますか?
設定されている権限:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
アクティビティ
public class Maping extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
XML レイアウト:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map_main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#6b6a6a"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#333333"
android:baselineAligned="false"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.97"
android:orientation="vertical" >
<TextView
android:id="@+id/mapname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:textColor="#ffffff"
android:textSize="20dp"
android:text="@string/map" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#8da635" >
<Button
android:id="@+id/addplace"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/add" />
</LinearLayout>
</LinearLayout>
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0lz3OFI5uqLUtnyTYnfbV-lWI6pL5NzX-BUk2dg"
android:clickable="true"
android:enabled="true" >
</com.google.android.maps.MapView>
</LinearLayout>
ログキャット
07-16 10:46:49.180: E/AndroidRuntime(364): FATAL EXCEPTION: main
07-16 10:46:49.180: E/AndroidRuntime(364): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{hopscriber.com/hopscriber.com.Maping}: java.lang.ClassNotFoundException: hopscriber.com.Maping in loader dalvik.system.PathClassLoader[/data/app/hopscriber.com-1.apk]
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.os.Looper.loop(Looper.java:130)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-16 10:46:49.180: E/AndroidRuntime(364): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 10:46:49.180: E/AndroidRuntime(364): at java.lang.reflect.Method.invoke(Method.java:507)
07-16 10:46:49.180: E/AndroidRuntime(364): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-16 10:46:49.180: E/AndroidRuntime(364): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-16 10:46:49.180: E/AndroidRuntime(364): at dalvik.system.NativeStart.main(Native Method)
07-16 10:46:49.180: E/AndroidRuntime(364): Caused by: java.lang.ClassNotFoundException: hopscriber.com.Maping in loader dalvik.system.PathClassLoader[/data/app/hopscriber.com-1.apk]
07-16 10:46:49.180: E/AndroidRuntime(364): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
07-16 10:46:49.180: E/AndroidRuntime(364): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
07-16 10:46:49.180: E/AndroidRuntime(364): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-16 10:46:49.180: E/AndroidRuntime(364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)