ActionBar
is not supported for below API 11 level.Thats why you are getting error.Read this documentation.
To make your code work in lower version, you have to use android-support-v7-appcompat
instead of ActionBar
.Read the below blog about how to migrate from ActionBar
to android-support-v7-appcompat
.
http://android-developers.blogspot.in/2013/08/actionbarcompat-and-io-2013-app-source.html
EDIT :
you can download and setup the support library as mentioned here
Below is my explanation based on your updated code,
-To enable up navigation in beginning in Android 4.1 (API level 16),
you can declare the logical parent of each activity by specifying the android:parentActivityName
attribute in the element.
-If your app supports Android 4.0 and lower, include the Support Library
with your app and add a <meta-data>
element inside the . Then specify the parent activity as the value for android.support.PARENT_ACTIVITY
, matching the android:parentActivityName
attribute like below example,
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" />
</activity>
For more info read
http://developer.android.com/training/implementing-navigation/ancestral.html
Hope it helps you.