我用intent在第一个Activity跳到第二个时报异常,出现:unfortunately,XX has stopped!
两个都注册了,两边的调试在虚拟器中都可以正常,请问是什么原因?
第一个Activitty:
fl0.setOnTouchListener(new OnTouchListener() {
//触摸屏幕后执行
@Override
public boolean onTouch(View v, MotionEvent event) {
Intent intent=new Intent();
intent.setClass(Start.this, MainActivity.class);
startActivity(intent);
Start.this.finish();
return true;
}
});
------------------------------------------------------------------------------------------------------
Manifest.xml中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zhutiansoft"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:icon="@drawable/fyicon"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".Start"
android:theme="@android:style/Theme.Holo.NoActionBar">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="@string/app_name"
android:name= ".MainActivity"
android:theme="@android:style/Theme.Holo.NoActionBar">
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
----------------------------------------------------------------------------------
这是error:
07-12 03:30:52.705: E/memtrack(3706): Couldn't load memtrack module (No such file or directory)
07-12 03:30:52.705: E/android.os.Debug(3706): failed to load memtrack module: -2
07-12 03:30:55.535: E/memtrack(3717): Couldn't load memtrack module (No such file or directory)
07-12 03:30:55.535: E/android.os.Debug(3717): failed to load memtrack module: -2
07-12 03:30:56.215: E/libEGL(52): called unimplemented OpenGL ES API
07-12 03:30:56.215: E/libEGL(52): called unimplemented OpenGL ES API
07-12 03:30:56.215: E/libEGL(52): called unimplemented OpenGL ES API
07-12 03:30:56.215: E/libEGL(52): called unimplemented OpenGL ES API
07-12 03:30:56.225: E/SurfaceFlinger(52): glCheckFramebufferStatusOES error 1939282271
07-12 03:30:56.225: E/SurfaceFlinger(52): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
07-12 03:30:56.225: E/libEGL(52): called unimplemented OpenGL ES API
07-12 03:30:56.225: E/libEGL(52): called unimplemented OpenGL ES API
07-12 03:31:27.895: E/dalvikvm-heap(3728): Out of memory on a 2850832-byte allocation.
07-12 03:31:28.295: E/AndroidRuntime(3728): FATAL EXCEPTION: main
07-12 03:31:28.295: E/AndroidRuntime(3728): Process: com.zhutiansoft, PID: 3728
07-12 03:31:28.295: E/AndroidRuntime(3728): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zhutiansoft/com.zhutiansoft.MainActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>