Im following the Android Tutorial at:
http://developer.android.com/training/basics/actionbar/setting-up.html
Im on part where we add the Action Bar. Im getting errors at every step.
1) First The tutorial first says to add this
<uses-sdk android:minSdkVersion="11" ... />
and then says to add this:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="18" />
at the end. So which should it be?
2) Second Another issue is that when I add the:
public class MainActivity extends ActionBarActivity { ... }
I get an error saying Cannot Resolve symbol ActionBarActivity.
So I go to set up the library:
http://developer.android.com/tools/support-library/setup.html
I already downloaded the Support Library. I have 2 build.gradle files. The one I think is the right one is at the same level as SRC, not inside it. And it looks like this in the end:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.+'
// this is for your application
}
and then this to the MainActivity imports:
import android.app.ActionBar;
import android.support.v7.app.ActionBar;
But the word support in the second import is in red and cannot be resolved
Could not fine method compile() for arguments [com.android.support:appcompat-v7:18.0.+] on root project.
3) Third When I change my theme to this:
<activity android:theme="@style/Theme.AppCompat.Light" ... >
I get a cannot resolve that line.
4) Fourth Finally since I changed my MainActivity extends to ActionBarActivity, in the manifest file I get a red line under:
android:name="com.example.myfirstapp.MainActivity"
presumably because that class now has an error.
The tutorials doesn't seem to be up to date.
Im getting this error related to the ActionBarActivity...