I am trying to install my App on the phone, and at run time i received the following errors:
errors:
java.lang.NullPointerException: lock == null
08-11 13:51:59.106 3380-3380/com.example.com.ecoassistant_03 E/AndroidRuntime: at java.io.Reader.<init>(Reader.java:64)
08-11 13:51:59.106 3380-3380/com.example.com.ecoassistant_03 E/AndroidRuntime: at java.io.BufferedReader.<init>(BufferedReader.java:107)
08-11 13:51:59.106 3380-3380/com.example.com.ecoassistant_03 E/AndroidRuntime: at java.io.BufferedReader.<init>(BufferedReader.java:95)
08-11 13:51:59.106 3380-3380/com.example.com.ecoassistant_03 E/AndroidRuntime: at com.example.com.ecoassistant_03.Populator.populate(Populator.java:38)
08-11 13:51:59.106 3380-3380/com.example.com.ecoassistant_03 E/AndroidRuntime: at com.example.com.ecoassistant_03.ActMain.onOptionsItemSelected(ActMain.java:1182)
08-11 13:51:59.106 3380-3380/com.example.com.ecoassistant_03 E/AndroidRuntime: at android.app.Activity.onMenuItemSelected(Activity.java:3205)
code
Populator populate = new Populator();
populate.populate(this, new File(Environment.getExternalStorageDirectory() + "/database/" + "kaAllNodesNumbered.txt"));
public void populate(Context context, File file) {
this.mCtx = context;
this.mSQLiteHelper = new SQLiteHelper(this.mCtx);
//this.mSQLiteHelper.deleteALLRows();
//Log.i(TAG, "total rows: " + this.mSQLiteHelper.getTotalRowsInDB());
try {
this.mFR = new FileReader(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
this.mBR = new BufferedReader(this.mFR); //LINE 38 <<<<=============
...
...
...
}
Note: the required permission are added in to the manifest file and the file "kaAllNodesNumbered.txt" and the path is correct as well
Please help me to fin dthe where the errors come from