Android的线程与未捕获的异常退出(组= 0x4000fe70)错误 [英] Android thread exiting with uncaught exception (group=0x4000fe70) Error
问题描述
我试图让一个闪屏。
我尝试code。在2.3版本一切正常。
但是,当我试图在Android 2.1系统下一个版本的code,我得到一个错误。
Hi I am trying to make a splash screen. I try the code at 2.3 version everything is ok. but when ı try the code at android 2.1 an lower versions, I get an error.
我也尝试的Galaxy Tab上,但没有问题。
Also I try on the galaxy tab but there is no problem.
我怎样才能确保我的应用程序是机器人的可运行多种版本。
How can I sure to my application is runnable other versions of androids.
该错误是在模拟器上1.5
The errors is on the emulator 1.5
03-09 10:32:20.016: D/AndroidRuntime(841): Shutting down VM
03-09 10:32:20.016: W/dalvikvm(841): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
03-09 10:32:20.016: E/AndroidRuntime(841): Uncaught handler: thread main exiting due to uncaught exception
03-09 10:32:20.026: E/AndroidRuntime(841): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.activities/com.activities.SplashScreenActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class java.lang.reflect.Constructor
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.os.Looper.loop(Looper.java:123)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.ActivityThread.main(ActivityThread.java:3948)
03-09 10:32:20.026: E/AndroidRuntime(841): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 10:32:20.026: E/AndroidRuntime(841): at java.lang.reflect.Method.invoke(Method.java:521)
03-09 10:32:20.026: E/AndroidRuntime(841): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
03-09 10:32:20.026: E/AndroidRuntime(841): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
03-09 10:32:20.026: E/AndroidRuntime(841): at dalvik.system.NativeStart.main(Native Method)
03-09 10:32:20.026: E/AndroidRuntime(841): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class java.lang.reflect.Constructor
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.LayoutInflater.createView(LayoutInflater.java:512)
03-09 10:32:20.026: E/AndroidRuntime(841): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
03-09 10:32:20.026: E/AndroidRuntime(841): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.Activity.setContentView(Activity.java:1626)
03-09 10:32:20.026: E/AndroidRuntime(841): at com.activities.SplashScreenActivity.onCreate(SplashScreenActivity.java:33)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
03-09 10:32:20.026: E/AndroidRuntime(841): ... 11 more
03-09 10:32:20.026: E/AndroidRuntime(841): Caused by: java.lang.reflect.InvocationTargetException
03-09 10:32:20.026: E/AndroidRuntime(841): at android.widget.LinearLayout.<init>(LinearLayout.java:92)
03-09 10:32:20.026: E/AndroidRuntime(841): at java.lang.reflect.Constructor.constructNative(Native Method)
03-09 10:32:20.026: E/AndroidRuntime(841): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.LayoutInflater.createView(LayoutInflater.java:499)
03-09 10:32:20.026: E/AndroidRuntime(841): ... 21 more
03-09 10:32:20.026: E/AndroidRuntime(841): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020016 a=-1 r=0x7f020016}
03-09 10:32:20.026: E/AndroidRuntime(841): at android.content.res.Resources.loadDrawable(Resources.java:1609)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.View.<init>(View.java:1725)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.View.<init>(View.java:1674)
03-09 10:32:20.026: E/AndroidRuntime(841): at android.view.ViewGroup.<init>(ViewGroup.java:271)
03-09 10:32:20.026: E/AndroidRuntime(841): ... 25 more
在code面值为;
The code par is;
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_splash_screen);
tv = (TextView) findViewById(R.id.LoadingBarTextView);
loadTextID = 1;
splashTextHandler = new Handler() {
public void handleMessage(Message msg2) {
if (loadTextID == 1) {
tv.setText("Loading..");
loadTextID = 2;
} else if (loadTextID == 2) {
tv.setText("Loading...");
loadTextID = 3;
} else {
tv.setText("Loading.");
loadTextID = 1;
}
}
};
Thread splashTread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
while (isActive && (waited < splashTime1)) {
sleep(500);
if (isActive) {
waited += 500;
splashTextHandler.sendMessage(splashTextHandler
.obtainMessage());
}
}
} catch (InterruptedException e) {
// do nothing
} finally {
/*
finish();
Intent i = new Intent();
i.setClassName("com.activities",
"com.activities.DashboardActivity");
startActivity(i);
*/
}
}
};
splashTread.start();
这是什么问题?
推荐答案
这将如果您发布的XML文件更加清晰,但我认为你正在尝试使用非绘制资源作为绘制项目。
例如这样: view.setBackground(R.id.something)
It would be more clear if you post your xml file, but I think you are trying to use a non-drawable resource as a drawable item.
for example this: view.setBackground(R.id.something)
这篇关于Android的线程与未捕获的异常退出(组= 0x4000fe70)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!