I'm trying to add handler for custom scheme... i've registered scheme in my application manifest, but all fails to start.
My manifest file part:
<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>
code part with which i'm trying to invoke viewer:
public开发者_运维问答 void onClick(View v) {
Intent dataViewerIntent = new Intent(Intent.ACTION_VIEW,
contentLink);
owner.startActivity(dataViewerIntent);
}
ContentLink looks like this:
freesmsmap://localhost?long=37,68888012&lat=55,76819212
But instead of starting activity i got this error:
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)
What am i doing wrong? It seems like it could not find needed class... Or uses wrong version of it.
This sounds like a google Maps API problem. I would check to make sure you are building with the Google APIs.
also check this out. Cannot resolve MapActivity class on Android
精彩评论