android - Crash while starting the third activity -
i'm new in android. i'm having problem right now. app crashes when starting 3rd activity
here code
package com.example.anagramgame; import android.app.activity; import android.os.bundle; import android.database.cursor; import android.widget.toast; public class level_list extends activity{ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.level_list); dbadapter db = new dbadapter(this); db.open(); cursor c = db.getallquestions(); if(c.movetofirst()) { { displaytitle(c); }while (c.movetonext()); } db.close(); } public void displaytitle(cursor c) { toast.maketext(this, "id: " + c.getstring(0) + "\n" + "answer: " + c.getstring(1) + "\n" + "question: " + c.getstring(2) + "\n" + "hint: " + c.getstring(3) + "\n" + "flag: " + c.getstring(4) + "\n" + "level:" + c.getstring(5), toast.length_long).show(); } }
and here xml
<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <tablelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tablelayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/background" > <tablerow android:id="@+id/tablerow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dip" android:gravity="left"> <imagebutton android:id="@+id/home_button" android:background="@drawable/home_button" android:layout_width="45dip" android:layout_height="50dip" /> </tablerow> </tablelayout> </scrollview>
and lastly android manifest
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.anagramgame" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="10" android:targetsdkversion="14" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.anagramgame.main" android:configchanges="orientation|keyboardhidden|screensize" android:label="@string/app_name" android:theme="@style/fullscreentheme" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name="stage"></activity> <activity android:name="level_list"></activity> </application> </manifest>
on logcat it's writen "message: failed load file project anagramgame. plugin: com.android.ide.eclipse.adt"
anyone know whats wrong this?
looks issue in manifest can define activity , see if resolves issue :
android:theme="@style/theme.transparent" > <intent-filter> <action android:name="com.example.anagramgame.level_list" /> android:theme="@style/fullscreentheme" <category android:name="android.intent.category.default" /> </intent-filter> </activity>
when call 3rd activity put intent name "com.example.anagramgame.level_list"
Comments
Post a Comment