Привет, я пытаюсь создать веб-браузер с Flash для Android 3.0 API 11, я искал решение в течение нескольких дней, но не смог найти ничего полезного, я не знаю, где проблема ..? ЭТО ПОКАЖИТСЯ НА ЭМУЛЯТОР, КОГДА Я НАЧИНАЮ ЕГО! ПОЖАЛУЙСТА ПОМОГИ! :(
код ошибки
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>