我制作了一个在模拟器以及中小型手机上运行良好的应用程序。但是在平板电脑上运行时,它总是只显示横向模式。我还使用了单独的布局和布局-土地布局。我没有得到背后的原因。这是代码:
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();
}
}
}
请帮助我。在此先感谢。