Skip to content

Commit

Permalink
Fixed a bug causing crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
trife committed Jun 5, 2015
1 parent b9d77b3 commit d96541b
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 72 deletions.
4 changes: 2 additions & 2 deletions Field Book/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fieldbook.tracker"
android:versionCode="240"
android:versionName="2.4.0">
android:versionCode="241"
android:versionName="2.4.1">

<uses-sdk
android:minSdkVersion="14"
Expand Down
2 changes: 1 addition & 1 deletion Field Book/res/raw/changelog_releases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Plot scrolling speed accelerates the longer the arrow is pressed
New Advanced Setting to disable left, right, or both entry arrows if no data has been collected
Field Book checks for updates
Spaces in imported column names replaced with underscores
Renamed default exported files
Changed default name for exported files
Map temporarily removed
More errors written to error logs
Updated strings for clarity
Expand Down
3 changes: 3 additions & 0 deletions Field Book/res/raw/dev_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
29
Fixed a bug causing crashes

28
Advanced settings layout reorganized
Trait default values no longer stored upon field import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public int getVersion() {
try {
v = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, e.getMessage());
Log.e(TAG, "" + e.getMessage());
}
return v;
}
Expand Down
42 changes: 21 additions & 21 deletions Field Book/src/com/fieldbook/tracker/ConfigActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public int getVersion() {
try {
v = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException e) {
Log.e("Field Book",e.getMessage());
Log.e("Field Book","" + e.getMessage());
}
return v;
}
Expand Down Expand Up @@ -847,7 +847,7 @@ protected Integer doInBackground(Integer... params) {
System.out.println(exportFile.getText().toString());
shareFile(file);
} catch (Exception e) {
ErrorLog("ExportDataError.txt", e.getMessage());
ErrorLog("ExportDataError.txt", "" + e.getMessage());
fail = true;
}
}
Expand All @@ -869,7 +869,7 @@ protected Integer doInBackground(Integer... params) {
csvWriter.writeTableFormat(concat(newRanges, exportTraits), newRanges.length);
shareFile(file);
} catch (Exception e) {
ErrorLog("ExportDataError.txt", e.getMessage());
ErrorLog("ExportDataError.txt", "" + e.getMessage());
fail = true;
}
}
Expand All @@ -891,7 +891,7 @@ protected Integer doInBackground(Integer... params) {
+ ep.getString("LastName", ""), ep.getString("Location", ""));
shareFile(file);
} catch (Exception e) {
ErrorLog("ExportDataError.txt", e.getMessage());
ErrorLog("ExportDataError.txt", "" + e.getMessage());
fail = true;
}
}
Expand All @@ -916,7 +916,7 @@ protected Integer doInBackground(Integer... params) {
csvWriter.writeTableFormat(concat(newRanges, exportTraits), newRanges.length);
shareFile(file);
} catch (Exception e) {
ErrorLog("ExportDataError.txt", e.getMessage());
ErrorLog("ExportDataError.txt", "" + e.getMessage());
fail = true;
}
}
Expand Down Expand Up @@ -972,9 +972,9 @@ protected Integer doInBackground(Integer... params)
}
catch (Exception e)
{
ErrorLog("ExportDatabaseError.txt", e.getMessage());
ErrorLog("ExportDatabaseError.txt", "" + e.getMessage());
e.printStackTrace();
error = e.getMessage();
error = "" + e.getMessage();
fail = true;
}

Expand Down Expand Up @@ -1034,10 +1034,10 @@ protected Integer doInBackground(Integer... params) {
try {
MainActivity.dt.importDatabase(mChosenFile);
} catch (Exception e) {
ErrorLog("ImportDatabase.txt", e.getMessage());
ErrorLog("ImportDatabase.txt", "" + e.getMessage());
e.printStackTrace();

error = e.getMessage();
error = "" + e.getMessage();

fail = true;
}
Expand Down Expand Up @@ -1078,7 +1078,7 @@ private void shareFile(File filePath) {
try {
startActivity(Intent.createChooser(intent, "Sending File..."));
} catch(Exception e) {
Log.e("Field Book",e.getMessage());
Log.e("Field Book","" + e.getMessage());
}
}
}
Expand Down Expand Up @@ -1129,7 +1129,7 @@ private boolean verifyUniqueColumnCSV(String path) {

return true;
} catch (Exception n) {
ErrorLog("VerifyUniqueError.txt", n.getMessage());
ErrorLog("VerifyUniqueError.txt", "" + n.getMessage());
n.printStackTrace();
return false;
}
Expand Down Expand Up @@ -1669,7 +1669,7 @@ private void createDir(String path) {
blankFile.createNewFile();
scanFile(blankFile);
} catch (IOException e) {
ErrorLog("DirectoryError.txt", e.getMessage());
ErrorLog("DirectoryError.txt", "" + e.getMessage());
}
}
}
Expand All @@ -1689,7 +1689,7 @@ private void loadFile() {
}

} catch (Exception n) {
ErrorLog("ExcelError.txt", n.getMessage());
ErrorLog("ExcelError.txt", "" + n.getMessage());
}

}
Expand All @@ -1701,7 +1701,7 @@ private void loadFile() {
importColumns = cr.readNext();

} catch (Exception n) {
ErrorLog("CSVError.txt", n.getMessage());
ErrorLog("CSVError.txt", "" + n.getMessage());
}
}

Expand Down Expand Up @@ -1849,13 +1849,13 @@ protected Integer doInBackground(Integer... params) {
try {
cr.close();
} catch (Exception f) {
ErrorLog("CSVError.txt", f.getMessage());
ErrorLog("CSVError.txt", "" +f.getMessage());
}

try {
fr.close();
} catch (Exception f) {
ErrorLog("CSVError.txt", f.getMessage());
ErrorLog("CSVError.txt","" + f.getMessage());
}

// These 2 lines are necessary due to importing of range data.
Expand All @@ -1869,7 +1869,7 @@ protected Integer doInBackground(Integer... params) {
newDir.mkdirs();

} catch (Exception e) {
ErrorLog("CSVError.txt", e.getMessage());
ErrorLog("CSVError.txt", "" + e.getMessage());
e.printStackTrace();
fail = true;

Expand Down Expand Up @@ -1959,7 +1959,7 @@ public void ErrorLog(String sFileName, String sErrMsg) {

scanFile(file);
} catch (Exception e) {
Log.e("Field Book",e.getMessage());
Log.e("Field Book","" + e.getMessage());
}
}

Expand Down Expand Up @@ -2044,7 +2044,7 @@ protected Integer doInBackground(Integer... params) {
newDir.mkdirs();

} catch (Exception e) {
ErrorLog("ImportExcelError.txt", e.getMessage());
ErrorLog("ImportExcelError.txt", "" + e.getMessage());
e.printStackTrace();
fail = true;

Expand Down Expand Up @@ -2240,13 +2240,13 @@ public void onClick(DialogInterface dialog, int which) {
try {
ConfigActivity.thisActivity.finish();
} catch (Exception e) {
Log.e("Field Book", e.getMessage());
Log.e("Field Book", "" + e.getMessage());
}

try {
MainActivity.thisActivity.finish();
} catch (Exception e) {
Log.e("Field Book", e.getMessage());
Log.e("Field Book", "" + e.getMessage());
}
}

Expand Down
2 changes: 1 addition & 1 deletion Field Book/src/com/fieldbook/tracker/DatagridActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void onItemClick(AdapterView<?> parent, View v,
try {
plotId = plotIdData[(position / cols) - 1];
} catch (ArrayIndexOutOfBoundsException e) {
Log.e("Field Book", e.getMessage());
Log.e("Field Book", "" + e.getMessage());
}
makeToast(plotId);
}
Expand Down
Loading

0 comments on commit d96541b

Please sign in to comment.