GithubHelp home page GithubHelp logo

Comments (1)

afollestad avatar afollestad commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.