Comments (1)
Copying in the above.
private fun setupViewPager(viewPager: ViewPager) {
val adapter = Adapter(childFragmentManager)
adapter.addFragment(MediaItemFragment.newInstance(MediaID(TimberMusicService.TYPE_ALL_SONGS.toString(), null)), this.getString(R.string.songs))
adapter.addFragment(MediaItemFragment.newInstance(MediaID(TimberMusicService.TYPE_ALL_ALBUMS.toString(), null)), this.getString(R.string.albums))
adapter.addFragment(MediaItemFragment.newInstance(MediaID(TimberMusicService.TYPE_ALL_PLAYLISTS.toString(), null)), this.getString(R.string.playlists))
adapter.addFragment(MediaItemFragment.newInstance(MediaID(TimberMusicService.TYPE_ALL_ARTISTS.toString(), null)), this.getString(R.string.artists))
adapter.addFragment(MediaItemFragment.newInstance(MediaID(TimberMusicService.TYPE_ALL_FOLDERS.toString(), null)), this.getString(R.string.folders))
adapter.addFragment(MediaItemFragment.newInstance(MediaID(TimberMusicService.TYPE_ALL_GENRES.toString(), null)), this.getString(R.string.genres))
viewPager.adapter = adapter
}
internal class Adapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {
private val mFragments = ArrayList<Fragment>()
...
This is wrong, and as a result, if you open a Playlist, rotate the screen; then the app resets back to the viewpager, and the playlist will no longer open again.
after process death, I got this
02-02 04:23:35.139 8311-8311/com.naman14.timberx W/MBServiceCompat: removeSubscription called for type: 1 | media_id: null | caller: self which is not subscribed
removeSubscription called for type: 3 | media_id: null | caller: self which is not subscribed
removeSubscription called for type: 0 | media_id: null | caller: self which is not subscribed
02-02 04:23:35.208 8311-8311/com.naman14.timberx D/AndroidRuntime: Shutting down VM
02-02 04:23:35.209 8311-8311/com.naman14.timberx E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.naman14.timberx, PID: 8311
java.lang.IllegalArgumentException: description must have a non-empty media id
at android.support.v4.media.MediaBrowserCompat$MediaItem.<init>(MediaBrowserCompat.java:529)
at android.support.v4.media.MediaBrowserCompat$MediaItem.fromMediaItem(MediaBrowserCompat.java:494)
at android.support.v4.media.MediaBrowserCompat$MediaItem.fromMediaItemList(MediaBrowserCompat.java:513)
at android.support.v4.media.MediaBrowserCompat$SubscriptionCallback$StubApi21.onChildrenLoaded(MediaBrowserCompat.java:776)
at android.support.v4.media.MediaBrowserCompatApi21$SubscriptionCallbackProxy.onChildrenLoaded(MediaBrowserCompatApi21.java:133)
at android.media.browse.MediaBrowser$7.run(MediaBrowser.java:541)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I have no idea what this means beyond "the app crashed" because I don't know enough about MediaBrowserCompat. It seems to happen if you are process death-ing on a playlist.
from timberx.
Related Issues (20)
- Touch target size is too small for "Playlist" and "Back" buttons in Now playing view HOT 1
- Exclude audio files that are shorter than a certain amount of seconds
- Display Recently added albums HOT 1
- Intent not working properly
- Feature request
- Build Error while compiling in Android Studio 4.1.2 HOT 2
- It Play music on its own
- Lyrics Won't Work
- Can i edit this apps logo,id, name & upload it to playstore ? I want to have all the other thing as it is. Is there Any issue of copyright ?
- Toggling shuffle does not show correct next song
- Sleep timer or Exit App after playing X songs
- Factors Behind Updating Third-Party Libraries in Mobile Apps
- Copycat/clone on Google Play HOT 1
- a play question about click playnext button
- File
- Timberx example for the new jetpack media3 library by google
- App not compatible with Android Auto anymore HOT 1
- Search button on Top Left is hard to reach
- Where to find "about" part in Android Studio
- Add to Fdroid HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timberx.