我想在我的应用程序中实现全屏。我发现这段代码可以做到这一点:
public class FullScreen extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
}
或通过 AndroidManifest.xml
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
好吧,没有人去。当我启动它时,两者都会使我的应用程序崩溃。错误是“不幸的是应用程序已停止”。有谁知道这个问题?
最佳答案
尝试使用此代码使您的 Activity FULL_SCREEN
<style name="NoTitle" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
</style>
找申请
添加
android:theme="@style/NoTitle">
看起来像:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/NoTitle" >
关于android - 全屏Android "Unfortunately application has stopped"为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16708372/