- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我不知道为什么会这样,我无法重现它。它在控制台中。
我真的很抱歉只输入了代码和日志猫,但我什至无法阅读日志猫,我之前没有遇到过这样的问题,我什至不知道从哪里开始。任何帮助将不胜感激。
这是日志猫,
android.os.BadParcelableException: ClassNotFoundException when unmarshalling: bitsie.playmee.musicplayer.free.classes.SongDetails
at android.os.Parcel.readParcelableCreator(Parcel.java:2147)
at android.os.Parcel.readParcelable(Parcel.java:2097)
at android.os.Parcel.readValue(Parcel.java:2013)
at android.os.Parcel.readListInternal(Parcel.java:2343)
at android.os.Parcel.readArrayList(Parcel.java:1703)
at android.os.Parcel.readValue(Parcel.java:2034)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2314)
at android.os.Bundle.unparcel(Bundle.java:249)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:1273)
at android.support.v4.app.FragmentManagerImpl.throwException(Unknown Source)
beginTransaction
putFragment
getFragment
saveFragmentInstanceState
dump
makeOpenCloseAnimation
makeFadeAnimation
loadAnimation
moveToState
moveToState
moveToState
addFragment
removeFragment
findFragmentById
findFragmentByTag
enqueueAction
allocBackStackIndex
setBackStackIndex
popBackStackState
restoreAllState
attachActivity
dispatchConfigurationChanged
dispatchCreateOptionsMenu
dispatchPrepareOptionsMenu
dispatchOptionsItemSelected
at android.support.v4.app.FragmentManagerImpl.throwException(Unknown Source)
beginTransaction
putFragment
getFragment
saveFragmentInstanceState
dump
makeOpenCloseAnimation
makeFadeAnimation
loadAnimation
moveToState
moveToState
moveToState
addFragment
removeFragment
findFragmentById
findFragmentByTag
enqueueAction
allocBackStackIndex
setBackStackIndex
popBackStackState
restoreAllState
attachActivity
dispatchConfigurationChanged
dispatchCreateOptionsMenu
dispatchPrepareOptionsMenu
dispatchOptionsItemSelected
at android.support.v4.app.BackStackRecord.run(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.makeInactive(Unknown Source)
attachFragment
execPendingActions
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(Unknown Source)
performPendingDeferredStart
hideFragment
freeBackStackIndex
addBackStackState
dispatchContextItemSelected
dispatchOptionsMenuClosed
transitToStyleIndex
at android.support.v4.app.FragmentStatePagerAdapter.setPrimaryItem(Unknown Source)
finishUpdate
at android.support.v4.view.ViewPager.initViewPager(Unknown Source)
setCurrentItem
setCurrentItemInternal
setCurrentItemInternal
scrollToItem
setPageTransformer
setInternalPageChangeListener
distanceInfluenceForSnapDuration
smoothScrollTo
addNewItem
populate
calculatePageOffsets
infoForChild
recomputeScrollPosition
onPageScrolled
completeScroll
isGutterDrag
determineTargetPage
onSecondaryPointerUp
canScroll
executeKeyEvent
getChildRectInPagerCoordinates
access$000
access$200
at android.support.v4.view.ViewPager.populate(Unknown Source)
requestParentDisallowInterceptTouchEvent
arrowScroll
at android.support.v4.view.ViewPager$3.run(Unknown Source)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:543)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5111)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
at dalvik.system.NativeStart.main(Native Method)
这是类的代码
public class SongDetails implements Parcelable
{
public SongDetails( int _ID, String click_no, String Album, String Artist, String Path, String Time, String song, String sortBy, int albumID,
String audioID )
{
this._ID = _ID;
this.click_no = click_no;
this.Album = Album;
this.Artist = Artist;
this.Path = Path;
this.Time = Time;
this.song = song;
this.sortBy = sortBy;
this.albumID = albumID;
this.audioID = audioID;
}
public SongDetails( Parcel in )
{
this._ID = in.readInt( );
this.Path = in.readString();
this.song = in.readString( );
this.Album = in.readString( );
this.Artist = in.readString( );
this.Time = in.readString( );
this.sortBy = in.readString( );
this.click_no = in.readString( );
this.albumID = Integer.parseInt( in.readString( ) );
this.audioID = in.readString( );
}
@Override
public int describeContents( )
{
return 0;
}
@Override
public void writeToParcel( Parcel dest, int flags )
{
dest.writeInt( _ID );
dest.writeString( Path );
dest.writeString( song );
dest.writeString( Album );
dest.writeString( Artist );
dest.writeString( Time );
dest.writeString( sortBy );
dest.writeString( click_no );
dest.writeString( String.valueOf( albumID ) );
dest.writeString( audioID );
}
public static final Parcelable.Creator < SongDetails > CREATOR = new Parcelable.Creator < SongDetails >( ) {
public SongDetails createFromParcel( Parcel in )
{
return new SongDetails( in );
}
public SongDetails [ ] newArray( int size )
{
return new SongDetails [ size ];
}
};
}
Activity 代码,正在读取可打包数据
Bundle bundle = getIntent( ).getExtras( );
if ( bundle != null )
{
if ( GlobalSongList.GetInstance( ).getCheck( ) == 0 )
{
try
{
GlobalSongList.GetInstance( ).setPosition( bundle.getInt( "Data2", 0 ) );
if(bundle.getParcelableArrayList( "Data1" )!=null)
{
ArrayList < SongDetails > list =
bundle.getParcelableArrayList( "Data1" );
GlobalSongList.GetInstance( ).SetNowPlayingList( list );
}
CMDNAME = bundle.getString( IConstant.CMDNAME );
}
catch ( Exception e )
{
// e.printStackTrace( );
}
}
comefrom = bundle.getString( "comefrom" );
isFromRecentAdded = bundle.getBoolean( "fromRecentAdded", false );
click_no = bundle.getString( "click_no_playlist" );
最佳答案
我认为问题在于您在解码 SongDetails
列表时没有设置类加载器。
您可以执行以下操作来读取 "Data1"
:
if(bundle.getParcelableArrayList( "Data1" )!=null) {
bundle.setClassLoader (SongDetails.class.getClassLoader());
ArrayList < SongDetails > list = bundle.getParcelableArrayList( "Data1" );
// Rest of your code
}
关于android.os.BadParcelableException : ClassNotFoundException when unmarshalling:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30129924/
我的应用在尝试访问外部依赖项时遇到 NoClassDefFoundError,但仅限于作为 jar 运行时。 使用 Intellij,我有一个带有主类的简单应用程序,其中包含一些对外部依赖项(例如 s
我收到以下异常: java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstr
我正在尝试使用eclipse和tomcat调试solr4.6源代码。我收到错误消息:HTTP 状态 500 - {msg=SolrCore 'collection1' 由于初始化失败而不可用:[sch
我是新来的,很抱歉我的英语不好;)。 我尝试使用以下代码在 java 中加载插件 jar: package testprogramm; import java.io.File; import java
我重新安装了 ADT Bundle,因为我在更新 eclipse 后遇到了一些问题。 现在,当我想测试我的应用程序时,出现以下异常: 06-05 10:33:35.770: E/AndroidRunt
我浏览过现有的帖子,这些帖子处理在 Eclipse 中的 Tomcat 下运行 Java Web 应用程序的 ClassNotFoundException。 我无法提供源代码和配置 Artifact
我忙于我的应用一个多星期,突然: 11-12 07:59:17.860 1653-1653/nl.test.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: ma
我的应用程序有问题,昨天一切正常,但今天我更新了 sdk,现在当我尝试运行我的应用程序时,出现这样的错误 05-21 00:14:19.285: W/dalvikvm(7061): Unable t
我正在阅读 JPA docs在 Spring ,我正在尝试重组我的代码。 我现在所拥有的: BrewerRepository @Repository public class BrewerReposi
我想像 BalusC's example 一样实现 fileUpload . 不幸的是,我已经在努力声明 servlet。 Extensions Filter javax.faces
在某些机器上运行这个小程序不起作用,但在其他机器上它工作得很好。在所有情况下看起来都安装了 JRE 1.6.0_26。 var attributes = {codebase:'http://kas
我将跟随这个非常简单的教程(http://www.tutorialspoint.com/hadoop/hadoop_mapreduce.htm)一起学习,直到我尝试运行Java文件为止,一切运行良好。
我看到了帖子,并按照流程进行了操作。但这没有用。 ClassNotFoundException, while running example job of Hadoop 请帮助我。 创建的 mapre
我尝试在cloudera quickstart vm上为hadoop运行Mahout Kmeans示例。我在这里读link to clouudera block和这里stack overflow po
我有一个mapreduce程序,其中我使用Hcatalog从Hive表'A'中获取带有HcatInputFormat的详细信息,对其进行处理,然后使用HcatOutput格式将其写回到Hive表'B'
我是激发应用程序编程的新手,因此在这里为这个基本的编程而苦苦挣扎。 我有 scala ide 并附加了来自最新 hadoop 和 spark 发行版的相关 jar 文件。我正在使用的只有一个基本的 s
我正在尝试在本地模式下运行Spark示例,但是正在获取以下堆栈跟踪: Exception in thread "main" java.lang.NoClassDefFoundError: org/ap
我有以下代码: // Test TODO remove try { System.out.println(System.getProperties().getPrope
我有以下文件: src/my_proj/myns.clj: (ns my-proj.myns) (defrecord MyRecord [a b c]) 测试/my_proj/myns_test.c
我试图让应用程序动态加载某些类,然后调用启动方法,但问题是,由于 ClassLoader 不同,一个类无法调用另一个类的方法,但是正如我已经用 google 搜索的那样,我用父类创建了两个类加载器。这
我是一名优秀的程序员,十分优秀!