我正在开发一个应用程序,它使用minSdkVersion = 10作为姜饼。它在所有的姜饼设备上工作正常,但是当我尝试在4.0.3模拟器(ICS)上运行它时,它总是停下来。有什么设置我需要调整?android 2.3.3未在android 4.0.3上运行
这里是我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.das"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
和logcat的错误是这样的
02-22 15:03:40.217: E/global(514): Deprecated Thread methods are not supported.
02-22 15:03:40.217: E/global(514): java.lang.UnsupportedOperationException
02-22 15:03:40.217: E/global(514): at java.lang.VMThread.stop(VMThread.java:85)
02-22 15:03:40.217: E/global(514): at java.lang.Thread.stop(Thread.java:1280)
02-22 15:03:40.217: E/global(514): at java.lang.Thread.stop(Thread.java:1247)
02-22 15:03:40.217: E/global(514): at com.example.SpelloGrande.splash$1.run(splash.java:48)
飞溅活动
public class splash extends Activity {
//how long until we go to the next activity
protected int _splashTime = 3000;
private Thread splashTread;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
final splash sPlashScreen = this;
// thread for displaying the SplashScreen
splashTread = new Thread() {
@Override
public void run() {
try {
synchronized(this){
//duration
wait(_splashTime);
}
} catch(InterruptedException e) {}
finally {
finish();
//start a new activity
Intent i = new Intent();
i.setClass(sPlashScreen, MainActivity.class);
startActivity(i);
stop();
}
}
};
splashTread.start();
}
//Function that will handle the touch
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
synchronized(splashTread){
splashTread.notifyAll();
}
}
return true;
}
}
邮政splash.java:48和周围的代码 – 2013-02-22 07:14:26
重复的问题:http://stackoverflow.com/q/8686861/620338 – 2013-02-22 07:18:14
你去那里。我在我的java代码中看到我的splash的第48行是stop();其中有一条线,并说'方法停止()从线程类型已被弃用' – Jerome 2013-02-22 07:19:14