Когда я запускаю его, я сразу же приближаюсь к силе.Я никогда не могу понять ошибки logcat.Я использую Eclipse вместе с Android SDK.Вот ошибка Logcat, но что это значит?
02-29 12:59:35.875: E/AndroidRuntime(9759): FATAL EXCEPTION: main
02-29 12:59:35.875: E/AndroidRuntime(9759): java.lang.RuntimeException: Unable to start activity ComponentInfo{izzy.n/izzy.n.IzzynActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.os.Handler.dispatchMessage(Handler.java:99)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.os.Looper.loop(Looper.java:130)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-29 12:59:35.875: E/AndroidRuntime(9759): at java.lang.reflect.Method.invokeNative(Native Method)
02-29 12:59:35.875: E/AndroidRuntime(9759): at java.lang.reflect.Method.invoke(Method.java:507)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-29 12:59:35.875: E/AndroidRuntime(9759): at dalvik.system.NativeStart.main(Native Method)
02-29 12:59:35.875: E/AndroidRuntime(9759): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
02-29 12:59:35.875: E/AndroidRuntime(9759): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:684)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
02-29 12:59:35.875: E/AndroidRuntime(9759): at android.view.Layout
02-29 12:59:43.347: I/Process(9759): Sending signal. PID: 9759 SIG: 9
Спасибо за помощь всем
и вот main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<include
android:id="@+id/include1"
android:layout_width="160dp"
android:layout_height="200dp"
android:layout_marginRight="15dp"
android:layout_marginTop="280dp"
layout="@layout/main" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="69dp"
android:text="@string/button1" />
</RelativeLayout>
Вот AndroidActivity(Java-файл для main.xml)
package izzy.n;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.Manifest;
public class IzzynActivity extends Activity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button wg = (Button) findViewById(R.id.button1);
wg.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(IzzynActivity.this, notes.class);
IzzynActivity.this.startActivity(myIntent);
}
});
}
}
Вот манифест Android:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="izzy.n"
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="izzy.n.IzzynActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="izzy.n.notes"
android:label="@string/notes"></activity>
</application>
</manifest>