java - Error when I use app-compact v7 in my project for using tool bar -


i getting error when try add toolbar application using following code

@suppresswarnings("deprecation")  public class mainactivity extends actionbaractivity implements  ichangefragementlistener { private drawerlayout mdrawerlayout;  private listview mdrawerlist;  public static final string tag = "mainactivity";  arraylist<string> mgroupitem = new arraylist<string>();  private boolean mreinstance; imageview menu_iconimageview; int flag=0; @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);     setgroupdata();     toolbar toolbar=(toolbar)findviewbyid(r.id.tool);     setsupportactionbar(toolbar);     } 

my toolbar.xml is

<toolbar  android:id="@+id/tool" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="#819ff7" android:elevation="4dp"    /> 

and error shown is

android.support.v7.app.appcompatdelegateimplv14 01-29 13:34:46.336: e/androidruntime (16928): @ android.support.v7.app.appcompatdelegate.create(appcompatdelega 01-29 13:34:46.336: e/androidruntime (16928): @ android.support.v7.app.appcompatdelegate.create(appcompatdelegate.java:117) 01-29 13:34:46.336: e/androidruntime (16928): @ android.support.v7.app.appcompatactivity.getdelegate(appcompatactivity.java:456)

<android.support.v7.widget.toolbar      android:id="@+id/tool"     android:layout_width="match_parent"     android:layout_height="?attr/actionbarsize"     android:background="#819ff7"     android:elevation="4dp" /> 

Comments