Je développe une application qui utilise minSdkVersion = 10 pour pain d'épice. il fonctionne bien sur tous les périphériques en pain d'épice mais quand j'essaye de l'exécuter sur l'émulateur 4.0.3 (ICS) il s'arrête toujours. Y a-t-il des paramètres que je dois ajuster?android 2.3.3 ne fonctionne pas sur android 4.0.3
ici est mon manifeste
<?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" />
et l'erreur sur logcat est ce
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)
splash activité
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;
}
}
Poster splash.java:48 et le code entourant –
double question: http://stackoverflow.com/q/8686861/620338 –
vous y allez. J'ai vu sur mon code java la ligne 48 de mon splash est stop(); qui a une ligne à travers elle et dit 'La méthode stop() du type Thread est deprecated' – Jerome