VideoView is not displayed on a Fragment

后端 未结 3 919
走了就别回头了
走了就别回头了 2021-02-14 04:43

I have a problem in running a video in Samsung S3(Android 4.1.1), the issue seems to be because the videoview is on a fragment because if I put it on and activity, it works. Als

3条回答
  •  攒了一身酷
    2021-02-14 05:05

    I have a similar problem, and i solved it changing:

     MediaController mediaController = new MediaController(getActivity().getApplicationContext());
    

    to this (In a fragmet):

     MediaController mediaController = new MediaController(getActivity());
    

    Hope this helps,...

    EDIT

    Look at this class

    http://code.google.com/p/sinaweibo-honeycomb/source/browse/branches/sinaweibo-merged/src/com/lenovo/dll/SinaWeibo/VideoFragment.java?r=71

提交回复
热议问题