How can I get an Android MediaController to appear from layout xml?

前端 未结 7 1766
无人及你
无人及你 2020-12-28 11:10

I\'ve created a layout.xml file with the following XML, but I can\'t get the MediaController to appear at all.



        
7条回答
  •  爱一瞬间的悲伤
    2020-12-28 11:54

    You can prevent the MediaController from hiding extending MediaController and override hide() to do nothing. eg:

    class UnhideableMediaController extends MediaController
    {
        // override whichever contstructors you need to. 
        public UnhideableMediaController(Context context)
        {
          super(context);
        }
    
        // override hide to do nothing
        public void hide()
        {
          // don't hide
        }
    }
    

提交回复
热议问题