dimanche 19 avril 2015

Unable to use android.support.v7.widget.toolbar

I'm trying to change status bar color in my application. For this I set MainActivity.java theme to "Theme.NoTitleBar.Fullscreen". Now, in my activity_main.xml, I create a frame layout followed by action bar. The project seems fine without errors but when I run it, the app crashes. Logcat shows something like.."unable to find class android.support.v7....". I added appcompat v7 library to my project but not sure whether i done it correctly. I'm a beginner, please help me.


activity_main.xml



<LinearLayout
xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.saregama.MainActivity"
android:orientation="vertical"
android:background="#1A1A1A">


<FrameLayout

android:layout_width="match_parent"
android:layout_height="25dp"
android:background="#3D3D99">

</FrameLayout>



<android.support.v7.widget.Toolbar
xmlns:android="http://ift.tt/nIICcg"
xmlns:app="http://ift.tt/GEGVYd"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#3D3D99"
></android.support.v7.widget.Toolbar>



<ListView
android:dividerHeight="1dp"
android:divider="#000000"
android:padding="10dp"
android:layoutAnimation="@anim/layout_bottom_to_top_slide"
android:smoothScrollbar="true"
android:animationCache="false"
android:scrollingCache="false"
android:id="@+id/product_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello_world" />


</LinearLayout>

Aucun commentaire:

Enregistrer un commentaire