我製作了一款在模擬器以及中小尺寸手機中工作正常的應用程序。但在平板電腦上運行時,它始終只顯示風景模式。我還使用了單獨的佈局和佈局土地layouts.I我沒有得到背後就是原因是代碼:應用程序始終在平板電腦上顯示風景模式
public class SplashActivity extends FragmentActivity
{
public void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
requestWindowFeature(1);
getWindow().setFlags(1024, 1024);
FragmentManager fragmentmanager = getSupportFragmentManager();
FragmentTransaction fragmenttransaction = fragmentmanager.beginTransaction();
if (getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE) {
setRequestedOrientation(0);
}
else
{
setRequestedOrientation(1);
}
fragmenttransaction.commit();
setContentView(R.layout.welcome);
new Handler().postDelayed(new SplashThread(), 2000L);
}
class SplashThread implements Runnable
{
SplashThread()
{
}
public void run()
{
SplashActivity.this.startActivity(new Intent(SplashActivity.this, McqHomePage.class));
SplashActivity.this.finish();
}
}
}
請幫助me.Thanks提前。
請幫幫我。 – user1662334