Jovish, you need to ask these questions elsewhere (like StackOverflow or
the Android Developers list).
I actually didn't even read your issue - because this list is for
Discussion, not Development.
You are not likely to get your answers here.
-M
On Wednesday, April 18, 2012 1:13:11 AM UTC-7, Jovish P wrote:
>
> In our app we are showing files stored in the sd card. We are unable to
> open html file which contains space in the name in default broswer.
> it invokes the default browser and shows following message "*The Web
> page at ontent://com.android.htmlprovider/sdcard/company
> info.html?test/html could not be loaded as: Th request file was not found.
> *" I am able to open same html file in other applications like text
> editor. No issues while opening html file without space in the name.
>
> This is the method we are using in our app
>
> public static void openDownloadedFile(final Context context, String
> filePath) {
> try {
> File file = new File(filePath);
> if(file != null && file.exists()){
> Uri uri = Uri.fromFile(file);
> Intent intent = new Intent();
> intent.setAction(android.content.Intent.ACTION_VIEW);
> intent.setDataAndType(uri, getMimeType(filePath));
> ((Activity) context).startActivity(intent);
> }
> } catch (ActivityNotFoundException activityNotFound) {
> DialogTemplate.getNeutralDialog(
> "No application has been installed to support this file!",
> "Ok", context).show();
> }
> catch (Exception exception) {
> DialogTemplate.getNeutralDialog(
> "Failed to open the file. Please try again",
> "Ok", context).show();
> }
> }
>
>
> Regards,
> Jovish
>
>
--
You received this message because you are subscribed to the Google Groups
"Android Discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-discuss/-/lEt0dMmi01AJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/android-discuss?hl=en.