- throw new IllegalArgumentException("The parameters to " + TextLoadAsyncTask.class.getName() + " must be (1) the file location and (2) the text view to update");
+ if (params.length != 1) {
+ throw new IllegalArgumentException("The parameter to " + TextLoadAsyncTask.class.getName() + " must be (1) the file location");
+ }
final String location = (String) params[0];
final String location = (String) params[0];
- mTextView = (TextView) params[1];
FileInputStream inputStream = null;
Scanner sc = null;
FileInputStream inputStream = null;
Scanner sc = null;
@@ -157,12+168,14 @@ public class PreviewTextFragment extends FileFragment {
IOException exc = sc.ioException();
if (exc != null) throw exc;
} catch (IOException e) {
IOException exc = sc.ioException();
if (exc != null) throw exc;
} catch (IOException e) {
+ Log_OC.e(TAG, e.getMessage(), e);
finish();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
finish();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
+ Log_OC.e(TAG, e.getMessage(), e);
finish();
}
}
finish();
}
}
@@ -175,8+188,13 @@ public class PreviewTextFragment extends FileFragment {