The essence of the application is simple, there is a WebView and through it a couple of pages are displayed. I tried to hide the ActionBar after that I started to fly out. I hide it in this way. style.xml

  <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> <!-- Customize your theme here. --> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> </style> 

All code

 public class MainActivity extends AppCompatActivity { WebView myBrowser; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myBrowser=(WebView)findViewById(R.id.myBrowser); myBrowser.getSettings().setJavaScriptEnabled(true); myBrowser.getSettings().setDomStorageEnabled(true); myBrowser.loadUrl("file:///android_asset/mypage.html"); int currentapiVersion= Build.VERSION.SDK_INT; if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN){ myBrowser.getSettings().setAllowUniversalAccessFromFileURLs(true); } /*---------------------------------*/ if(currentapiVersion>=19) { myBrowser.setLayerType(View.LAYER_TYPE_HARDWARE,null); } else{ myBrowser.setLayerType(View.LAYER_TYPE_SOFTWARE,null); } } 

manifest

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.user.recept"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> 
  • Error log please provide - Yury Pashkov
  • There are no errors, just a black screen, although if nothing is style.xml in the style.xml , everything works - zkolya
  • and the manifest file then - Yury Pashkov
  • Updated, now there is a manifesto - zkolya

2 answers 2

try so

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> 
  • Earned! Thank you! - zkolya

Try this:

 getActionBar().hide(); 

insert into onCreate ()