小编cja*_*son的帖子

Android,org.simpleframework.xml持久性异常,元素'foo'已被使用

我使用org.simpleframework.xml来处理Android应用程序的一些xml任务,并遇到以下错误,我无法弄清楚.

org.simpleframework.xml.core.PersistenceException: Element 'album' is already used with @org.simpleframework.xml.ElementList(inline=false, name=album, entry=, data=false, empty=true, required=true, type=void) on field 'albums' private java.util.List us.blah.sonar.xsd.simple.AlbumList.albums at line 5
at org.simpleframework.xml.core.Variable$Adapter.read(Variable.java:484)
at org.simpleframework.xml.core.Composite.readVariable(Composite.java:613)
at org.simpleframework.xml.core.Composite.readInstance(Composite.java:573)
Run Code Online (Sandbox Code Playgroud)

以下是我试图解组的XML示例:

<albumList> 
    <album id="3985" parent="3301" title="Bob Dylan - The Reissue Series Sampler" album="Bob Dylan - The Reissue Series Sampler" artist="48 - Masked and Anonymous [BSO] (2003)" isDir="true" created="2011-12-09T11:52:12"/> 
    <album id="3986" parent="3301" title="Soundtrack - Masked & Anonymous" album="Soundtrack - Masked & Anonymous" artist="48 - Masked and Anonymous [BSO] (2003)" isDir="true" coverArt="3986" …
Run Code Online (Sandbox Code Playgroud)

java xml android simple-framework

13
推荐指数
1
解决办法
6360
查看次数

Android MediaPlayer.reset()正在调用onCompletion

我遇到以下代码的问题.我在MediaController上调用了setPrevNextListener,并为Prev和Next定义了两个onClickListener.当我单击下一个按钮而不是前进一个轨道时,我前进两个轨道.这似乎是由于onCompletion被某种方式调用的事实.MediaPlayer.reset()是否会调用onCompletion?我已经包含了logcat输出和我的代码.如果我做错了,请告诉我.提前致谢.

logcat的:

02-24 00:36:34.826: D/MP(6675): Next Button Clicked, index was: 0
02-24 00:36:34.837: D/MP(6675): About to call Reset()
02-24 00:36:34.906: D/MP(6675): Inside setUpPlayer
02-24 00:36:34.917: D/MP(6675): Called setDataSource with index: 1
02-24 00:36:34.917: D/MP(6675): Leaving setUpPlayer
02-24 00:36:34.917: D/MP(6675): About to call prepareAsync()
02-24 00:36:34.937: D/MP(6675): Leaving next button
02-24 00:36:35.226: E/MediaPlayer(6675): Attempt to call getDuration without a valid mediaplayer
02-24 00:36:35.226: E/MediaPlayer(6675): error (-38, 0)
02-24 00:36:35.276: E/MediaPlayer(6675): Error (-38,0)
02-24 00:36:35.287: D/MP(6675): Inside onCompletion
02-24 00:36:35.337: D/MP(6675): About …
Run Code Online (Sandbox Code Playgroud)

android android-mediaplayer

6
推荐指数
2
解决办法
5101
查看次数