I noticed a problem regarding the position of a MediaController for a VideoView inside a Fragment . Here is a screenshot of how it looks on the Nexus 7 running Android 4.3: 
And here is a screenshot of the application on the Nexus 7 running Android 4.2.2: 
As you can see, the position of the MediaController is in the middle of my activity by API 17 or lower (tested on another tablet with 4.1.2). I noticed that the size of the MediaController is correct.
My fragment is shown in FrameLayout, the width of which is determined by its weight (0.6 here), therefore not by the specific dpi value.
I checked the source code of MediaController on Grepcode and compared version 4.3 with code 4.2.2 and there are minor changes with LayoutParams, but I canβt find a way to make this work.
I initialize my VideoView and MediaController in onActivityCreated () of my fragment
mMediaController = new MediaController(getActivity()); mMediaController.setAnchorView(videoView); videoView.setMediaController(mMediaController);
Does anyone know how I can position it correctly?
source share