我正在尝试为自定义方案添加处理程序...我已在我的应用程序清单中注册了方案,但都无法启动。
我的清单文件部分:
<application android:icon="@drawable/icon" android:label="@string/app_name" android:name=".SmsMarketApplication">
<uses-library android:name="com.google.android.maps" />
<activity android:name="com.a1systems.smsmarket.ViewMapActivity" android:label="@string/app_name" android:launchMode="standard" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="freesmsmap" android:host="localhost" />
</intent-filter>
</activity>
...
</application>
我试图调用查看器的代码部分:
public void onClick(View v) {
Intent dataViewerIntent = new Intent(Intent.ACTION_VIEW,
contentLink);
owner.startActivity(dataViewerIntent);
}
ContentLink看起来像这样:
freesmsmap://localhost?long=37,68888012&lat=55,76819212
但是没有开始活动,我得到了这个错误:
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): FATAL EXCEPTION: main
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at dalvik.system.DexFile.defineClass(Native Method)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:207)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:200)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.app.Instrumentation.newActivity(Instrumentation.java:1040)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1735)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1851)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.os.Handler.dispatchMessage(Handler.java:99)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.os.Looper.loop(Looper.java:150)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at android.app.ActivityThread.main(ActivityThread.java:4293)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at java.lang.reflect.Method.invokeNative(Native Method)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at java.lang.reflect.Method.invoke(Method.java:507)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
09-20 18:24:20.887: ERROR/AndroidRuntime(9580): at dalvik.system.NativeStart.main(Native Method)
我做错了什么?好像它找不到所需的类......或者使用错误的版本。
答案 0 :(得分:2)
这听起来像Google Maps API问题。我会检查以确保您使用Google API构建。