setSupportActionBar toolbar cannot be applied to (android.widget.Toolbar) error

前端 未结 13 1371
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 03:45

I\'ve been looking for an answer and I\'ve tried many possible solutions, but nothing seems to work..

I\'m trying to setup a Material Action Bar following this tutor

相关标签:
13条回答
  • 2020-11-30 04:01

    class must be extend of AppCompatActivity to resolve the problem of setSuppertActionBar that is not recognizable

    0 讨论(0)
  • 2020-11-30 04:01
    import android.support.v7.widget.Toolbar;
    

    import it into your java class

    0 讨论(0)
  • 2020-11-30 04:03

    In using toolbar you should extends AppCompatActivity and

    import android.support.v7.widget.Toolbar 
    
    0 讨论(0)
  • 2020-11-30 04:03

    ToolBar's name can easily be changed using

    android:label="My Activity"
    

    in your Manifest File. I just going through Manifest & found

    android:label 
    

    Helps to change according to the specific activity, Hope you'll give it a try

    0 讨论(0)
  • 2020-11-30 04:04

    Certify that your Manifest declaration includes android:theme="@style/AppTheme.NoActionBar" tag, like the following:

    <activity
        android:name=".PointsScreen"
        android:theme="@style/AppTheme.NoActionBar">
    </activity>
    
    0 讨论(0)
  • 2020-11-30 04:07

    Just change

    import android.widget.Toolbar;
    

    To

    import android.support.v7.widget.Toolbar;
    
    0 讨论(0)
提交回复
热议问题