android - missing ActionBar in material design -


I want to develop an Android app with Android Studio and new physical design and it looks great on Android 5.0 , But when I test my 4.4.2 app on the phone, the application of the actionbars is missing.

Here is my address:

  Android: allowBackup = "true" android: allowBackup = "true" android: icon = "@ drawable / Aisi_lancr" android: label = "@String / app_name" Android: Theme = "@ Style / Myself" & gt; & Lt; Activity Android: name = ". Main Activity" Android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; & Lt; / Application & gt;  

Styles Xml

  & lt; Resources & gt; & Lt ;! - Base app theme - & gt; & Lt; Style name = "Myself" Original = "Theme. AppCompat.Light" & gt; & Lt; / Style & gt;  

and build.gradle

  apply plugin: 'com.android.application' Android {compileSdkVersion 21 buildToolsVersion "21.0. 0 "defaultConfig {applicationId" com.example.app "minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName" 1.0 "} {buildTypes release {runProguard false proguardFiles getDefaultProguardFile ( 'ProGuard-android.txt'), 'proguard-rules.pro'}} } {dependency compilation FileTree (dir: 'libs', include: [ '* .jar']) 'com.android.support:appcompat-v7:+' compilation}  

Do you know where the error is?

Thank you! Simon

epike-v7 to use the action bar backport, you Referring to your activities inherited from ActionBarActivity

If you are not currently using AppCompat, or if you are starting with a scratch, here's how to set it:

  • All your activities should increase with ActionBarActivity It is spread from fractal activity from the v4 support library, so that you can continue using pieces.
  • All your subjects (who want an action bar / toolbar) should get from Theme.AppCompat. There are variants available including light and NoActionBar.
  • To display anything on an action strip, such as a SpinnerAdapter (for a list navigation in the Action Bar), make sure that you get the theme based reference of the action bar Using getSupportActionBar () (Via getThemedContext)
  • You should use static methods in MenuItemCompat for a call related to an action on a MenuItem.

Update : Note that Google AppCompatActivity has been migrated to the Akshnbrhwar activity Works & mdash; This is the only code that is nothing AppCompatActivity & mdash; But if you are going to use the app-com-v7 action bar backport, then you can better serve AppCompatActivity directly in detail.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -