I had used following code to show my screen in Portrait mode.
View root = findViewById(android.R.id.content);
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
root.getLayoutParams().height = width;
root.getLayoutParams().width = height;
root.requestLayout();
root.setPivotX(height);
root.setPivotY(height);
Animator anim = AnimatorInflater.loadAnimator(this, R.anim.rotate_90);
anim.setTarget(root);
anim.start();
My root view contain VideoView. After Screen rotation videoview played, but it doesn't show video frames, it plays only the audio of the video source only. And I need to show the mouse cursor on portrait mode. How to handle this?
Note:
I had tried to implement Portrait orientation to my Smart TV application.As per developer site their is no possibility to implement Portrait on Google TV. Refer this link