2012-03-25 20 views
0

Hi im Versuch, ein Webview mit Flash für Android 3.0 API 11 zu bauen, bin ich seit Tagen für eine Lösung suchen, aber könnte etwas nützlich finden, weiß ich nicht, wo das Problem ist ..? IT-CRASHS AUF DER EMULATOR, WENN ICH ES STARKE! Bitte helfen! :(Android 3.0 WebView stürzt ab

erorr Code

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; 
} 
} 

MAIN XML

<?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> 

Antwort

1

Sie haben eine Aktivität aufgeführt in Ihrem Manifest (xxxxx.com.xxxxx.xxxxxxctivity), das Sie versuchen zu starten, aber diese Klasse existiert nicht in Ihrem Projekt.

+1

und es ist wahrscheinlich ein Tippfehler auf den echten Klassennamen, überprüfen Sie Ihre Schreibweisen wird das Problem lösen. – Edison

+0

nono ich tippte xxxxx nicht meiner wirklichen Tätigkeit ... Entschuldigung dafür, aber seine App Privatsphäre. findest du überhaupt irgendwas falsch ohne das ?? : ( –