2012-03-25 3 views
0

Salut im essayant de construire un webview avec flash pour android 3.0 API 11, je cherchais depuis des jours maintenant pour une solution, mais pourrait trouver quelque chose d'utile, je ne sais pas où le problème est ..? IL CRASE SUR L'ÉMULATEUR QUAND JE LE COMMENCE! S'IL VOUS PLAÎT AIDE! :(Android 3.0 WebView se bloque

Code erorr

03-26 00:26:47.747: ERROR/AndroidRuntime(637): FATAL EXCEPTION: main 
03-26 00:26:47.747: ERROR/AndroidRuntime(637): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{xxxxx.com.xxxxx/xxxxx.com.xxxxx.xxxxxctivity}: java.lang.ClassNotFoundException: xxxxxx.com.xxxxx.xxxxxActivity in loader dalvik.system.PathClassLoader[/data/app/xxxxxx.com.xxxxxxvol-2.apk] 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1660) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.ActivityThread.access$1500(ActivityThread.java:123) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.os.Handler.dispatchMessage(Handler.java:99) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.os.Looper.loop(Looper.java:126) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.ActivityThread.main(ActivityThread.java:3997) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at java.lang.reflect.Method.invokeNative(Native Method) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at java.lang.reflect.Method.invoke(Method.java:491) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at dalvik.system.NativeStart.main(Native Method) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637): Caused by: java.lang.ClassNotFoundException: xxxxx.com.xxxxx.xxxxxxctivity in loader dalvik.system.PathClassLoader[/data/app/xxxxxxx.com.xxxxxxxx-2.apk] 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at java.lang.ClassLoader.loadClass(ClassLoader.java:548) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at java.lang.ClassLoader.loadClass(ClassLoader.java:508) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.Instrumentation.newActivity(Instrumentation.java:1022) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) 
03-26 00:26:47.747: ERROR/AndroidRuntime(637):  ... 11 more 

JAVA CODE

package xxxxx.com.xxxxx; 

import android.app.Activity; 
import android.os.Bundle; 
import android.view.KeyEvent; 
import android.webkit.WebView; 
import android.webkit.WebViewClient; 
import android.webkit.WebSettings.PluginState; 

import com.google.ads.AdRequest; 
import com.google.ads.AdView; 


public class DemoriginalActivity extends Activity { 
private static final String WebSettings = null; 
/** Called when the activity is first created. */ 
private WebView webview; 



@Override 
public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.main); 

AdView adview = (AdView)findViewById(R.id.ad); 

AdRequest re = new AdRequest(); 
re.setTesting(true); 
adview.loadAd(re); 

webview = (WebView) findViewById(R.id.webview1); 

// workaround so that the default browser doesn't take over 
//Compile error: MyWebViewClient cannot be resolved to a type 
webview.setWebViewClient(new WebViewClient()); 
webview.getSettings().setPluginsEnabled(true); 
webview.getSettings().setPluginState(PluginState.ON); 

webview.getSettings().setBuiltInZoomControls(true); 

webview.getSettings().setJavaScriptEnabled(true); 
webview.loadUrl("http://google.com/"); 

} 



public boolean onKeyDown(int keyCode, KeyEvent event) { 
    if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) { 
     webview.goBack(); 
     return true; 
    } 
    return super.onKeyDown(keyCode, event); 
} 



public static String getWebsettings() { 
    return WebSettings; 
} 
} 

XML MAIN

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:keepScreenOn="true" 
    > 

    <WebView android:id="@+id/webview1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text = "Hello, world!" 
     android:keepScreenOn="true" 
     />    


<RelativeLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <com.google.ads.AdView 
    ads:adUnitId="xxxxxxxxxxx" 
    ads:adSize="BANNER" 
    android:id="@+id/ad" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true"/> 
    </RelativeLayout> 
    </RelativeLayout> 

Répondre

1

Vous avez une activité répertoriée dans votre manifeste (xxxxx.com.xxxxx.xxxxxxctivity) que vous essayez de démarrer, mais cette classe n'existe pas dans votre projet.

+1

et c'est probablement une faute de frappe au nom de la classe réelle, vérifiez que vos orthographes vont résoudre le problème. – Edison

+0

nono j'ai tapé xxxxx insted de mon activité réelle ... désolé pour cela, mais sa vie privée app. de toute façon trouvez-vous quelque chose de mal sans cela ?? : ( –

Questions connexes