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); }
Comments
Post a Comment