Я начал изучать Android-разработку и получил этот фрагмент с сайта разработки для Google Android, он продолжает падать.
Мои характеристики:
Android 4.0.3
API 15
Код:
package lewes.android.hello;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
Я получаю ...
Необычно, HelloAndroid не отвечает.
Пожалуйста, помогите мне!
МОЙ МАНИФЕТ:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lewes.android.hello"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HelloWorld"
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>
LogCat:
03-17 11:35:19.835: D/AndroidRuntime(562): Shutting down VM
03-17 11:35:19.835: W/dalvikvm(562): threadid=1: thread exiting with uncaught
exception (group=0x409c01f8)
03-17 11:35:19.914: E/AndroidRuntime(562): FATAL EXCEPTION: main
03-17 11:35:19.914: E/AndroidRuntime(562): java.lang.RuntimeException: Unable to
instantiate activity
ComponentInfo{lewes.android.hello/lewes.android.hello.HelloWorld}:
java.lang.ClassNotFoundException: lewes.android.hello.HelloWorld
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.ActivityThread.access$600(ActivityThread.java:123)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.os.Handler.dispatchMessage(Handler.java:99)
03-17 11:35:19.914: E/AndroidRuntime(562): at android.os.Looper.loop(Looper.java:137)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.ActivityThread.main(ActivityThread.java:4424)
03-17 11:35:19.914: E/AndroidRuntime(562): at
java.lang.reflect.Method.invokeNative(Native Method)
03-17 11:35:19.914: E/AndroidRuntime(562): at
java.lang.reflect.Method.invoke(Method.java:511)
03-17 11:35:19.914: E/AndroidRuntime(562): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-17 11:35:19.914: E/AndroidRuntime(562): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-17 11:35:19.914: E/AndroidRuntime(562): at dalvik.system.NativeStart.main(Native
Method)
03-17 11:35:19.914: E/AndroidRuntime(562): Caused by:
java.lang.ClassNotFoundException: lewes.android.hello.HelloWorld
03-17 11:35:19.914: E/AndroidRuntime(562): at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
03-17 11:35:19.914: E/AndroidRuntime(562): at
java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-17 11:35:19.914: E/AndroidRuntime(562): at
java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.Instrumentation.newActivity(Instrumentation.java:1023)
03-17 11:35:19.914: E/AndroidRuntime(562): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
03-17 11:35:19.914: E/AndroidRuntime(562): ... 11 more
03-17 11:40:20.114: I/Process(562): Sending signal. PID: 562 SIG: 9