zoukankan      html  css  js  c++  java
  • 异常 java.lang.RuntimeException: Error receiving broadcast Intent

    06-19 12:12:54.065: E/AndroidRuntime(11744): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.gloud.service.ACTION_MYSERVICE flg=0x10 (has extras) } in cn.gloud.client.activities.TvAssistantActivity$SearchDeviceBroadcastReceiver@43461d70
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:772)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Handler.handleCallback(Handler.java:615)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Handler.dispatchMessage(Handler.java:92)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Looper.loop(Looper.java:137)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.app.ActivityThread.main(ActivityThread.java:4866)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at java.lang.reflect.Method.invokeNative(Native Method)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at java.lang.reflect.Method.invoke(Method.java:511)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at dalvik.system.NativeStart.main(Native Method)
    06-19 12:12:54.065: E/AndroidRuntime(11744): Caused by: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class cn.gloud.client.entity.ServiceTypeEntity
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Parcel.readParcelable(Parcel.java:2086)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Parcel.readValue(Parcel.java:1965)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Parcel.readMapInternal(Parcel.java:2226)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Bundle.unparcel(Bundle.java:223)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.os.Bundle.getParcelable(Bundle.java:1165)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.content.Intent.getParcelableExtra(Intent.java:4467)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at cn.gloud.client.activities.TvAssistantActivity$SearchDeviceBroadcastReceiver.onReceive(TvAssistantActivity.java:284)
    06-19 12:12:54.065: E/AndroidRuntime(11744): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:762)
    06-19 12:12:54.065: E/AndroidRuntime(11744): ... 9 more

    原因就是一个实体类实现了parcelable接口,而没有在实体类里写下面的这些方法 ,而这些方法的内容都是需要自己去写的

    public int describeContents();  

    public void writeToParcel(Parcel dest, int flags);  

     public interface Creator<T> {}

    解决办法就是要么在实体类里加上这三个方法,并实现,要么就是实体类不要实现这个接口了,改换成Serializable接口

  • 相关阅读:
    A.3.1. 与MySQL客户端库的链接问题
    c++ mysqlclient library linkage problem Stack Overflow
    找房 爱合住, ihezhu.com
    21.4.5.1. MySQL Connector/C++ Connecting to MySQL
    如何对链接了mysqlclient的程序静态编译?
    分享:[组图] 科技圈最具权势 25 大女工程师
    linux 静态链接 mysql glibc 库的悲催过程 mango的日志 网易博客
    /usr/bin/ld: cannot find lgcc_s 问题解决小记
    « 静态编译的MySQL易挂起 »
    SQL C++代码自动生成器(sql2class)介绍 Newzai的专栏 博客频道 CSDN.NET
  • 原文地址:https://www.cnblogs.com/jss4j/p/4588894.html
Copyright © 2011-2022 走看看