public boolean isValidPin(String pin) {
type = false;
Cursor c =db .rawQuery( "select * from"+ pinTable+" where Pin='" + pin+ "'", null);
if (c.getCount() > 0)
{
c.moveToFirst();
type = true;
}
c.close();
return type;
}
androidのダイアログボックスにボタンがあります。クリックすると強制的に停止します...これはlogcatエラーです。
03-26 07:35:23.140: E/AndroidRuntime(16907): FATAL EXCEPTION: main
03-26 07:35:23.140: E/AndroidRuntime(16907): java.lang.NullPointerException
03-26 07:35:23.140: E/AndroidRuntime(16907): at com.android.lnt_form.WayDataBase.isValidPin(WayDataBase.java:147)
03-26 07:35:23.140: E/AndroidRuntime(16907): at com.android.lnt_form.LoginActivity$3.onClick(LoginActivity.java:133)
03-26 07:35:23.140: E/AndroidRuntime(16907): at android.view.View.performClick(View.java:4202)
03-26 07:35:23.140: E/AndroidRuntime(16907): at android.view.View$PerformClick.run(View.java:17340)
03-26 07:35:23.140: E/AndroidRuntime(16907): at android.os.Handler.handleCallback(Handler.java:725)
03-26 07:35:23.140: E/AndroidRuntime(16907): at android.os.Handler.dispatchMessage(Handler.java:92)
03-26 07:35:23.140: E/AndroidRuntime(16907): at android.os.Looper.loop(Looper.java:137)
03-26 07:35:23.140: E/AndroidRuntime(16907): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-26 07:35:23.140: E/AndroidRuntime(16907): at java.lang.reflect.Method.invokeNative(Native Method)
03-26 07:35:23.140: E/AndroidRuntime(16907): at java.lang.reflect.Method.invoke(Method.java:511)
03-26 07:35:23.140: E/AndroidRuntime(16907): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-26 07:35:23.140: E/AndroidRuntime(16907): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-26 07:35:23.140: E/AndroidRuntime(16907): at dalvik.system.NativeStart.main(Native Method)
plsヘルプ。どうすれば修正できますか?