I get an error while starting an activity, previously it was zero pointer exception, but now I do not know the error And its no longer working
Logkat:
02-18 13:15: 28.885: D / Dalevikam (328): GC_XteranLLOOLC 50K free, 53 % Free 2553K / 5379K, External 2730K / 3266K, paused 115ms 02-18 13:15, 29.762: D / dalvikvm (328): GC_EXTERNAL_ALLOC 1K free, 53% free 2552K / 5379K, External 6764K / 8447K, 51ms 02-18 13 is paused: 15: 45.312: D / Dalvikvm (328): GC_EXTERNAL_ALLOC released 11K, 52% free 2583K / 5379K, External 8695K / 10350K, paused 46ms 02-18 13:15:45 4582: D / AndroidRuntime (328): VM shutting down 02 - 18 13: 15: 45.582: W / dalvikvm (328): threadid = 1: Exit with thread unexpected exception (group = 0x40015560) 02-18 13:15: 45.592: E / AndroidRuntime (328): Severe Exception: Main 02- 18 13: 15: 45.592: E / Android Runtime (328): java.lang.RuntimeException: Unable to launch activity ComponentInfo {com.example.connectfour / com.example.con nectfour.ScoreActivity}: Java.lang.NullPointerException 02-18 13:15: 45.592: E / AndroidRuntime (328): android.app.ActivityThread.performLaunchActivity (Ac TetyThread.java:1647) on 02-18 13:15: 45.592: E / AndroidRuntime (328): 15: 45.592: E / AndroidRuntime (328): android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:1663) 02- 18 13 at android.app.ActivityThread.access $ 1500 (ActivityThread. Java: 117) 02-18 13:15: 45.592: E / AndroidRuntime (328): 15: 45.592: E / AndroidRuntime (android.app.ActivityThread $ H.handleMessage (ActivityThread.java:931) 02-18 13 at 328 ): Android.OS Handler Dispatch Message (Handler. Java: 99) 02-18 13:15: 45.592: E / Android Random (328): Android.OS Lopper. Lost (Looper.Jawyer 23) 02 -18 13:15: 45.592: E / AndroidRuntime (328): 15: 45.592: E / AndroidRuntime (328): java.lang android.app.ActivityThread.main (ActivityThread.java: 3683) on 02-18 13. Reflect.Method.invokeNative (basic method) 02-18 13:15: 45.592: E / Android time (328): at java.lang.reflect.Method.invoke (Mato d.java:507) 02-18 13:15: 45.592: E / AndroidRuntime (328): com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:839) on 02-18 13:15: 45.592: E / AndroidRuntime (328): com.android. 02-18 13:15: 45.592: E / AndroidRuntime (328) at internal.os.ZygoteInit.main (ZygoteInit.main (ZygoteInit.java:597)) on dalvik.system.NativeStart (basic method) 02-18 13:15: 45.592: E / AndroidTheTime (328): Reasons for: java.lang.NullPointerException 02-18 13:15: 45.592: E / Android Time (328): com.example .connectfour.Database.getScores (Database.java:57) 02- 18 13:15: 45.592: E / AndroidRuntime (328): com.example.connectfour.ScoreActivity $ MyCursorAdapter at & lt; Init & gt; (ScoreActivity.java:21.) 02-18 13:15: 45.592: E / Android Runtime (328): at com.example.connectfour.ScoreActivity.onCreate (ScoreActivity.java:49) 02-18 13:15: 45.592 : E / Android TimeTime (328): Android. App Instrumentation. Call ActivityAccount (InstrumentationJava 1.047) 02-18 13:15: 45.592: E / Android Time (328): Android. App ActiveTrade.Perform Launch Act (ActivityTrad.Java: 1611) 02-18 13:15: 45.592: E / Android Random (328): ... 11 and 02-18 13:15: 54.303: I / Process (328): PIC: 328 SIG: 9
Code
Personal Static Class DBHelper extends SQLiteOpenHelper {public DBHelper (reference reference) {super (reference, Database_Name, Null, DATABASE_VERSION); } @Override Public Zero OnCreate (SQLiteDatabase Database) {db.execSQL ("Create Table" + DATABASE_TABLE + "(" + KEY_ROWID + "integer primary key autoincrement," + KEY_NAME + "integer);); } @ Override Public Video OnUpgrade (SQLiteDatabase, DB, Int JuniorWarson, Int Newversion) {DB.XACSQLL ("empty tab if exists" + Database AboveBlue); OnCreate (database); }} Public Database (Reference Reference) {ourContext = context; } Open Public Database () {ourHelper = New DBHlp (ourContext); OurDatabase = ourHelper.getWritableDatabase (); This return; } Public Zero Closure () {ourHelper.close (); } Get the public cursor () {return to ourDatabase.rawQuery ("Select * FROM" + DataBabs, Zero); // a parameter}}
Code Score Activity: This is the activity line 21 where the super thing is:
@SuppressWarnings ("exclusion") public Mike's Adapter (Reference Reference) {Super (Reference, New Database (Reference) .getScores ()); ScoreIdx = getCursor () GetColumnIndex (Database.KEY_NAME); // Todo Auto-Generated Constructor Stub}
When you create your database class < D>
So when you are meeting, then Scoring will have you going to have a NPE.
Just try to open it.
Comments
Post a Comment