Hallo, ich habe ein TabHost mit 4 Tabs. In einem Tab wird eine LIstview angezeigt in der bei Klick eine WebView aufgerufen wird. Beim Aufruf stürzt die App ab.
HTML
public class LeseprobeActivity<T> extends Activity {
static final int MENU_IMPRESSUM = 0;
static final int MENU_EXIT = 1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.leseprobeactivity);
List valueList = new ArrayList<String>();
valueList.add("Titel");
valueList.add("Impressum");
valueList.add("Prolog");
valueList.add("Kapitel 1");
valueList.add("Kapitel 2");
valueList.add("Kapitel 3");
valueList.add("Kapitel 4");
valueList.add("Kapitel 5");
valueList.add("Kapitel 6");
valueList.add("Kapitel 7");
valueList.add("Kapitel 8");
valueList.add("Kapitel 9");
valueList.add("Kapitel 10");
valueList.add("Kapitel 11");
valueList.add("Kapitel 12");
valueList.add("Kapitel 13");
valueList.add("Kapitel 14");
valueList.add("Kapitel 15");
valueList.add("Kapitel 16");
valueList.add("Kapitel 17");
valueList.add("Kapitel 18");
valueList.add("Kapitel 19");
valueList.add("Kapitel 20");
valueList.add("Kapitel 21");
valueList.add("Kapitel 22");
valueList.add("Kapitel 23");
valueList.add("Kapitel 24");
valueList.add("Kapitel 25");
valueList.add("Kapitel 26");
valueList.add("Kapitel 27");
valueList.add("Epilog");
ListAdapter adapter = new ArrayAdapter<T>(getApplicationContext(), android.R.layout.simple_list_item_1, valueList);
final ListView lv = (ListView)findViewById(R.id.listView1);
lv.setAdapter(adapter);
lv.setOnItemClickListener(new OnItemClickListener() {
// @Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Intent intent = new Intent();
intent.setClassName(getPackageName(), getPackageName()+".ChapterActivity");
intent.putExtra("selected", lv.getAdapter().getItem(arg2).toString());
startActivity(intent);
}
});
}
}
Alles anzeigen
HTML
public class ChapterActivity extends Activity {
WebView mWebView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.chapter);
mWebView = (WebView) findViewById(R.id.webChapter);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("file:///android_asset/info.html");
}
}
Alles anzeigen
HTML
04-22 10:23:30.536: W/Resources(592): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050004}
04-22 10:23:30.617: D/dalvikvm(592): GC_FOR_ALLOC freed 101K, 3% free 9153K/9347K, paused 76ms
04-22 10:23:30.726: I/dalvikvm-heap(592): Grow heap (frag case) to 18.370MB for 9817472-byte allocation
04-22 10:23:30.866: D/dalvikvm(592): GC_CONCURRENT freed 5K, 2% free 18734K/18951K, paused 8ms+6ms
04-22 10:23:32.907: D/dalvikvm(592): GC_FOR_ALLOC freed 0K, 2% free 18735K/18951K, paused 40ms
04-22 10:23:33.156: I/dalvikvm-heap(592): Grow heap (frag case) to 39.431MB for 22089292-byte allocation
04-22 10:23:33.296: D/dalvikvm(592): GC_CONCURRENT freed 0K, 1% free 40306K/40583K, paused 5ms+10ms
04-22 10:23:34.656: D/gralloc_goldfish(592): Emulator without GPU emulation detected.
04-22 10:23:36.936: W/webcore(592): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
04-22 10:23:36.936: W/webcore(592): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
04-22 10:23:36.936: W/webcore(592): at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
04-22 10:23:36.936: W/webcore(592): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
04-22 10:23:36.936: W/webcore(592): at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
04-22 10:23:36.936: W/webcore(592): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
04-22 10:23:36.936: W/webcore(592): at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
04-22 10:23:36.936: W/webcore(592): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
04-22 10:23:36.936: W/webcore(592): at android.os.Handler.handleCallback(Handler.java:605)
04-22 10:23:36.936: W/webcore(592): at android.os.Handler.dispatchMessage(Handler.java:92)
04-22 10:23:36.936: W/webcore(592): at android.os.Looper.loop(Looper.java:137)
04-22 10:23:36.936: W/webcore(592): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-22 10:23:36.936: W/webcore(592): at java.lang.reflect.Method.invokeNative(Native Method)
04-22 10:23:36.936: W/webcore(592): at java.lang.reflect.Method.invoke(Method.java:511)
04-22 10:23:36.936: W/webcore(592): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-22 10:23:36.936: W/webcore(592): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-22 10:23:36.936: W/webcore(592): at dalvik.system.NativeStart.main(Native Method)
04-22 10:25:09.216: D/AndroidRuntime(592): Shutting down VM
04-22 10:25:09.216: W/dalvikvm(592): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-22 10:25:09.246: E/AndroidRuntime(592): FATAL EXCEPTION: main
04-22 10:25:09.246: E/AndroidRuntime(592): android.content.ActivityNotFoundException: Unable to find explicit activity class {de.siebenverlag.ebookverhaengnisvoll/de.siebenverlag.ebookverhaengnisvoll.ChapterActivity}; have you declared this activity in your AndroidManifest.xml?
04-22 10:25:09.246: E/AndroidRuntime(592): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.app.Activity.startActivityFromChild(Activity.java:3458)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.app.Activity.startActivityForResult(Activity.java:3210)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.app.Activity.startActivity(Activity.java:3297)
04-22 10:25:09.246: E/AndroidRuntime(592): at de.siebenverlag.ebookverhaengnisvoll.LeseprobeActivity$1.onItemClick(LeseprobeActivity.java:45)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.widget.AdapterView.performItemClick(AdapterView.java:292)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.widget.AbsListView.performItemClick(AbsListView.java:1058)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2514)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.widget.AbsListView$1.run(AbsListView.java:3168)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.os.Handler.handleCallback(Handler.java:605)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.os.Handler.dispatchMessage(Handler.java:92)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.os.Looper.loop(Looper.java:137)
04-22 10:25:09.246: E/AndroidRuntime(592): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-22 10:25:09.246: E/AndroidRuntime(592): at java.lang.reflect.Method.invokeNative(Native Method)
04-22 10:25:09.246: E/AndroidRuntime(592): at java.lang.reflect.Method.invoke(Method.java:511)
04-22 10:25:09.246: E/AndroidRuntime(592): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-22 10:25:09.246: E/AndroidRuntime(592): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-22 10:25:09.246: E/AndroidRuntime(592): at dalvik.system.NativeStart.main(Native Method)
Alles anzeigen