android - How to make one of the fragments full screen on landscape mode? -


my question may seem little confusing :

i'm developing application in have main activity , 4 fragments (4 pages) , need indicate use viewpagerindicator have swipe gesture .

fist of : in 1 of tabs (fragments) need play video on full screen mode , want force pass on landscape mode when chose appropriate tab ( call landscape tab ).

i did digging , found out fragment , can not such thing ( force window ,view , become landscape ), or did not found right answer , though used code below error logic because need call there main activity understood :

getactivity().requestwindowfeature(window.feature_no_title); getactivity().getwindow().setflags(windowmanager.layoutparams.flag_fullscreen,windowmanager.layoutparams.flag_fullscreen); 

this answer solved problem yours:

public class yourclassname extends fragmentactivity {  static boolean istablet = false; static actionbar actionbar = null;  public void oncreate(bundle savedinstancestate) { actionbar = getactionbar();  if ((getresources().getconfiguration().screenlayout & configuration.screenlayout_size_mask) >= configuration.screenlayout_size_large) {          setcontentview(r.layout.single_pane_fragment_layout);     istablet = true; } else {     setcontentview(r.layout.viewpager_fragment_layout); } 

https://stackoverflow.com/a/13831134/104085


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -