I know many people have had this problem and I have searched Google/Stack Overflow, but I somehow still can't figure out what I'm doing wrong.
package HelloWorld;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloWorldActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// TextView tv = new TextView(this);
// String hello = "Hello World!";
// tv.setText(hello);
// setContentView(tv);
}
}
I tried searching for unnecessary import android.R;
statements, as well as building/cleaning/refreshing/etc, but I just can't seem to figure it out. Maybe it's a problem with the way I've installed my SDKs? I don't think there is, but I'm very new to this so it's likely I made a blunder somewhere.
Also, I am getting this error:
[2011-12-13 18:18:46 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Users\MYNAME\Android Development\Hello World\Hello World\AndroidManifest.xml: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Can anyone help me? Thanks!
EDIT: My XML file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="HelloWorld Mylove"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HelloWorldActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>