2012-03-25 112 views
0

嗨即时通讯尝试建立一个用于Android 3.0 API的Flash的webview,我一直在寻找解决方案的日子,但可以找到任何有用的东西,我不知道问题在哪里..?当我启动它时,它就仿效了这个仿真器!请帮忙! :(Android 3.0 WebView崩溃

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代码

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

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

回答

1

你有一个上市活动在您试图启动的清单(xxxxx.com.xxxxx.xxxxxxctivity)中,但该类不存在于您的项目中。

+1

这可能是真实课程名称的拼写错误,请检查您的拼写是否可以解决问题。 – Edison 2012-03-25 23:48:05

+0

诺诺我键入了xxxxx insted我真正的活动......对不起,但它的应用程序的隐私。无论如何,你没有发现任何错误? :( – 2012-03-26 20:25:21