I recently took the plunge and bought a PDF viewer in the Market. This
has revealed one of the very few shortcomings of Steel compared to the
built-in browser, which allows you to invoke the relevant application
after the file finishes downloading.
It's hardly a super-huge hassle to simply save the file and open it
manually, but I just wanted to request this feature because it would
be pretty slick. It looks like all the built-in browser does to
achieve this effect is the following (run when an item in the download
list is clicked):
int filenameColumnId =
mDownloadCursor.getColumnIndexOrThrow(Downloads._DATA);
String filename = mDownloadCursor.getString(filenameColumnId);
int mimetypeColumnId =
mDownloadCursor.getColumnIndexOrThrow
(Downloads.COLUMN_MIME_TYPE);
String mimetype = mDownloadCursor.getString(mimetypeColumnId);
Uri path = Uri.parse(filename);
// If there is no scheme, then it must be a file
if (path.getScheme() == null) {
path = Uri.fromFile(new File(filename));
}
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
startActivity(intent);
} catch (ActivityNotFoundException ex) {
new AlertDialog.Builder(this)
.setTitle(R.string.download_failed_generic_dlg_title)
.setIcon(R.drawable.ssl_icon)
.setMessage(R.string.download_no_application)
.setPositiveButton(R.string.ok, null)
.show();
}
So if Steel did something similar (and simply did nothing if
startActivity failed due to no application associated with that MIME
type), that would be truly excellent!
Daniel