最近有个项目,需要跳转到第三方应用展示影片详情页,通过打印信息,可以找到要跳转的activity的名称或action,但是利用这个activity跳转之后,该详情页的背景图始终显示不出来,是我少传了参数吗?
因为需要在framework层加打印,打出intent跳转时携带的参数。在ActivityManagerService.java中的startActivityAsUser()方法中打印intent.toURI().toString()。其他应用都可以打印出跳转过程中传递的参数,activity的名字,action等信息,但这个应用一点击就闪退。给打印信息加了非空判断也是一样。去掉这个打印才正常启动。
第一次启动它是先打印出了首页传递的信息后,报错,页面卡在了启动页上;得按返回键才能退出,第二次是点击这个应用的图标,闪了一下黑屏后,没有反应了。
报的错误信息是:
ActivityManager: Activity Manager Crash. UID:10074 PID:7444 TRANS:3
java.lang.RuntimeException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = java.lang.Class)
at android.os.Parcel.readSerializable(Parcel.java:2949)
at android.os.Parcel.readValue(Parcel.java:2735)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3051)
at android.os.BaseBundle.unparcel(BaseBundle.java:257)
at android.os.BaseBundle.keySet(BaseBundle.java:488)
at android.content.Intent.toUriInner(Intent.java:9411)
at android.content.Intent.toUriFragment(Intent.java:9362)
at android.content.Intent.toUri(Intent.java:9353)
at android.content.Intent.toURI(Intent.java:9265)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4518)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4486)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:121)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2939)
at android.os.Binder.execTransact(Binder.java:674)
Caused by: java.lang.ClassNotFoundException: pixie.movies.pub.presenter.WelcomePresenter
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:629)
at android.os.Parcel$2.resolveClass(Parcel.java:2940)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1616)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1487)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1337)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:374)
at android.os.Parcel.readSerializable(Parcel.java:2943)
at android.os.Parcel.readValue(Parcel.java:2735)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3051)
at android.os.BaseBundle.unparcel(BaseBundle.java:257)
at android.os.BaseBundle.keySet(BaseBundle.java:488)
at android.content.Intent.toUriInner(Intent.java:9411)
at android.content.Intent.toUriFragment(Intent.java:9362)
at android.content.Intent.toUri(Intent.java:9353)
at android.content.Intent.toURI(Intent.java:9265)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4518)
……
04-17 05:24:10.243 1943-2818/system_process E/JavaBinder: *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
java.lang.RuntimeException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = java.lang.Class)
后面打印了一堆:Caused by: java.lang.ClassNotFoundException。
这是怎么回事?是因为权限问题吗?