0 / 0 / 0
Регистрация: 31.03.2013
Сообщений: 78
|
|
1
|
WebView ошибка
19.07.2013, 09:45. Показов 1337. Ответов 1
Помогите исправить ошибку
Сам код Java | 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| package com.example.list1;
import android.annotation.SuppressLint;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.webkit.WebView;
@SuppressLint("SetJavaScriptEnabled")
public class Main61Activity extends ListActivity {
WebView mWebView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main61);
mWebView = (WebView) findViewById(R.id.webview);
// включаем поддержку JavaScript
mWebView.getSettings().setJavaScriptEnabled(true);
// указываем страницу загрузки
mWebView.loadUrl("http://www.odnoklassniki.ru/bankubrr");
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu, menu);
return true;
}
} |
|
Логи
Java | 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
27
28
29
30
31
32
33
34
35
36
| 07-19 05:42:14.300: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.320: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.341: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.350: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.360: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.370: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.380: W/Resources(572): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090013}
07-19 05:42:14.500: D/gralloc_goldfish(572): Emulator without GPU emulation detected.
07-19 05:42:14.630: D/dalvikvm(572): GC_FOR_ALLOC freed 114K, 3% free 10152K/10375K, paused 62ms
07-19 05:42:14.730: D/dalvikvm(572): GC_CONCURRENT freed 5K, 2% free 10582K/10759K, paused 7ms+6ms
07-19 05:42:22.879: D/dalvikvm(572): GC_CONCURRENT freed 402K, 5% free 10625K/11143K, paused 5ms+8ms
07-19 05:42:22.949: D/AndroidRuntime(572): Shutting down VM
07-19 05:42:22.949: W/dalvikvm(572): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
07-19 05:42:23.039: E/AndroidRuntime(572): FATAL EXCEPTION: main
07-19 05:42:23.039: E/AndroidRuntime(572): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.list1/com.example.list1.Main61Activity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ActivityThread.access$600(ActivityThread.java:122)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.os.Handler.dispatchMessage(Handler.java:99)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.os.Looper.loop(Looper.java:137)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ActivityThread.main(ActivityThread.java:4340)
07-19 05:42:23.039: E/AndroidRuntime(572): at java.lang.reflect.Method.invokeNative(Native Method)
07-19 05:42:23.039: E/AndroidRuntime(572): at java.lang.reflect.Method.invoke(Method.java:511)
07-19 05:42:23.039: E/AndroidRuntime(572): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-19 05:42:23.039: E/AndroidRuntime(572): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-19 05:42:23.039: E/AndroidRuntime(572): at dalvik.system.NativeStart.main(Native Method)
07-19 05:42:23.039: E/AndroidRuntime(572): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ListActivity.onContentChanged(ListActivity.java:243)
07-19 05:42:23.039: E/AndroidRuntime(572): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:254)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.Activity.setContentView(Activity.java:1835)
07-19 05:42:23.039: E/AndroidRuntime(572): at com.example.list1.Main61Activity.onCreate(Main61Activity.java:17)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.Activity.performCreate(Activity.java:4465)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
07-19 05:42:23.039: E/AndroidRuntime(572): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
07-19 05:42:23.039: E/AndroidRuntime(572): ... 11 more |
|
0
|