1 pièce(s) jointe(s)
Convertir un SWF en application Android APK : erreur dans mon code
Bonjour tout le monde
Voilà mon problème : j'ai créé un nouvel opjet dans Eclipse pour convertir un jeu SWF vers Android APK.
Voici le code Java :
MainActivity.Java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
package com.jeuxdaily.dressupbaby;
import android.R;
import android.os.Bundle;
import android.app.Activity;
import android.webkit.WebSettings;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String url="file:///android_asset/baby-pink.swf"; //Include your swf file here.
WebView wv=(WebView)findViewById(R.id.web_engine);
WebSettings ws=wv.getSettings();
ws.setPluginState(PluginState.ON);
ws.setJavaScriptEnabled(true);
wv.loadUrl(url);
}
} |
Le problème est que ce code ne marche pas : il me donne une erreur sur setContentView(R.layout.activity_main);.
Pièce jointe 199262