- @Override
- protected void onPostExecute(Void aVoid) {
- super.onPostExecute(aVoid);
- mProgressBar.setVisibility(View.GONE);
- mTextPreviewList.setVisibility(View.VISIBLE);
- }
- }
-
- private class TextLineAdapter extends BaseAdapter {
- private static final int LIST_ITEM_LAYOUT = R.layout.text_file_preview_list_item;
- private final List<String> items = new ArrayList<String>();
-
- private void add(String line) {
- items.add(line);
- notifyDataSetChanged();
- }
-
- private void clear() {
- items.clear();
- notifyDataSetChanged();
- }
-
- @Override
- public int getCount() {
- return items.size();
- }
-
- @Override
- public String getItem(int position) {
- if (position >= items.size())
- throw new IllegalArgumentException();
- return items.get(position);
- }
+ if (textView != null) {
+ textView.setText(new String(stringWriter.getBuffer()));
+ textView.setVisibility(View.VISIBLE);
+ }