Код следующий:
database = new DataBase(CompaniesActivity.this);
sql = database.getWritableDatabase();
Cursor cursor = sql.query(database.TABLE_COMPANY, new String[]{
database.UID, database.COMPANY_NAME, database.COMPANY_INDUSTRY}, null,
null,
null,
null,
null
);
while (cursor.moveToNext()) {
String name = cursor.getString(cursor
.getColumnIndex(database.COMPANY_NAME));
name_out.setText(name + "");
}
Вылетает вот на этом шаге:
String name = cursor.getString(cursor .getColumnIndex(database.COMPANY_NAME));
Logcat:
06-04 17:07:36.651 16266-16266/plays_app.app_1 W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40a611f8)
06-04 17:07:36.667 16266-16266/plays_app.app_1 E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NullPointerException
at plays_app.app_1.CompaniesActivity.dialog_info(CompaniesActivity.java:156)
at plays_app.app_1.CompaniesActivity$1.onItemClick(CompaniesActivity.java:103)
at android.widget.AdapterView.performItemClick(AdapterView.java:292)
at android.widget.AbsListView.performItemClick(AbsListView.java:1067)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2523)
at android.widget.AbsListView$1.run(AbsListView.java:3184)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)
Подскажите в чем может быть дело, пожалуйста.