I have reached the second exercise in the tutorial on android.com called "Adding the action bar". It seems that you are not supposed to create a new project in this exercise, but rather continue with the one from the first exercise. I am using Android 2.3.6, and choose path accordingly. The tutorial then describes some changes to be made:
public class MainActivity extends ActionBarActivity { ... }
in MainActivity.java. This seems to be in conflict with how MainActivity is defined earlier, as an extension of activity. It also renders the content of the class seemingly meaningless.
The tutorial now tells me to enter this into AndroidManifest.xml
<manifest ... >
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="18" />
...
</manifest>
android:minSdkVersion is previously set to 8. Is this important?
This method should be added to something, To what exactly?
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu items for use in the action bar
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_activity_actions, menu);
return super.onCreateOptionsMenu(menu);
}
There are another few methods like this. I don't know where they are supposed to go. They seem more optional, though.
This renders an ocean of errors. Virtually nothing can be resolved to a type.
Update (by OP - was a suggested edit to Nezam's answer): I get the following errors: 1. "ActionBarActivity cannot be resolved to a type". 2. "The method OnCreate(Bundle) of type MainActivity must override or implement a supertype method". Doesn't the @override before the function declaration care for that? (I'm new to this. I'm not even quite sure what an override is.) 3. "ActionBarActivity cannot be resolved to a type". 4. "The method setContentView" is undefined for main activity".
(I get more errors, this is just a start)
What is clean supposed to do? When I try to run it, something called aapt.exe crashes. – user2536262 2 days ago
Follow my edit.. – Nezam 2 days ago
I've been working further with the tutorial, among other things trying to confirm that the library is properly included. I try to install the Android Support Library as described in the tutorial. The SDK manager eventually lets me know nothing can be downloaded or installed because I'm trying to contact the unknown host dl-ssl.google.com. How can you proceed from here? – user2536262 2 days ago
thats a different issue altogether.You should mark this questions solution and move on to :stackoverflow.com/questions/15796780/… – Nezam 2 days ago
The SDK manager problem is now fixed. The other problems remain. – user2536262 yesterday
You better start a fresh thread to resolve the other problems.The problem in the original post is solved right? – Nezam yesterday
The "ocean of errors" remain. The problem has not been solved, it has been redefined. I guess that calls for a new post. – user2536262 19 hours ago