Getting AppCompat does not support the current theme features exception after upgrading to version AppCompat v22.1.0 issue

后端 未结 6 786
孤城傲影
孤城傲影 2021-01-19 01:56

Previously i was using AppCompat with version 21.1.2 in my project for the purpose of material design toggle with toolbar. But after upgrading to AppCompat v22.1.0, my app h

6条回答
  •  佛祖请我去吃肉
    2021-01-19 02:34

    just Use this in your style.xml no other editing is needed

     
    

    don't add anything in to activity file please leave it

      public class Main extends ActionBarActivity {
    
     @Override
     protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
    
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
    }
    }
    

提交回复
热议问题