Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ public void run()
{
try
{
// attempt file connect/download (possible IOEXception)
Connection conn = new Connection(page.server, page.port);
conn.getBinary(page.selector, file);

// attempt view intent (possible ActivityNotFoundException)
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.fromFile(file));
context.startActivity(intent);
}
catch (final IOException e)
catch (final IOException | ActivityNotFoundException e)
{
e.printStackTrace();
//inform the user of the error
Expand All @@ -139,11 +145,6 @@ public void run()
}
});
}

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.fromFile(file));
context.startActivity(intent);
}
}).start();
}
Expand All @@ -155,4 +156,4 @@ public void run()
Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
}
}