I want to add a button to MediaController. So I extended the MediaController class, created a button, and added it to the frame layout. But the newly added button is not displayed during operation.
Please find the code below.
public class VideoController extends MediaController { private Button searchButton; public VideoController(Context context) { super(context); searchButton = new Button(context); searchButton.setText("Search"); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.gravity = Gravity.RIGHT; System.out.println("Adding a button"); addView(searchButton, params);
what am i doing wrong here. Any suggestions would be helpful.
Thanks in advance.
source share