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);
On Wed, Apr 18, 2012 at 4:13 AM, Jovish P <android.f...@gmail.com> 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 Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
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(); > } > }
*The "water cooler" of Android discussion. You can discuss just about anything Android-related here, ideas for the Android platform, announcements about your applications, discussions about Android devices, community resources... As long as your discussion is related to Android, it's on-topic here. * But the OP should also be aware that it also says "*However, if you have a discussion here that could belong on another list, you are probably not reaching all of your target audience here and may want to consider shifting to a more targeted list."*
> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
On an Xperia Arc with 2.3.4, the Html viewer comes up, and the window says "Web page not available".
It also contains a link that is differnet from what was specified by the intent, something like "content://com.android.htmlfileprovider/<file path here>?text/html".
On an HTC Incredible S it's working now, but I received an OTA firmware update just recently, and before then, it was also broken.
It's also broken on my Galaxy Nexus with 4.0.2, so the fix on the Incredible S was made by HTC just for their own firmwares.
On the devices where this fails, an almost identical link but without the embedded (and encoded) space works just fine.
> /The "water cooler" of Android discussion. You can discuss just about > anything Android-related here, ideas for the Android platform, > announcements about your applications, discussions about Android > devices, community resources... As long as your discussion is related > to Android, it's on-topic here. > / > But the OP should also be aware that it also says "/However, if you > have a discussion here that could belong on another list, you are > probably not reaching all of your target audience here and may want to > consider shifting to a more targeted list."/
> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to > android-developers@googlegroups.com > <mailto:android-developers@googlegroups.com> > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > <mailto:android-developers%2Bunsubscribe@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
*Mike *, I was not aware about this. From now onwards I will ask my doubts on StackOverFlow and Android Developers list also.Thanks for pointing this out. As per Justin we can discuss anything related to Android in this group. So I think it is not an issue. I think the chances to get reply from this groups will be less as you said.
*Nadeem Hasan, *
"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." The URL looks malformed to me. The scheme part is "ontent"? Or is this a copy/paste issue?
It is a copy/paste issue . Sorry for that. I gone through the link which you posted.I was not able to find out the solution in that link. Thanks for your help............
*Kostya Vasilyev*
Thanks for pointing out all these points. We are thinking that , only we are facing this issue. Android developers are aware about this issue ? Any work around for this issue ? Please let us know if you found out any solution for this.
> On an Xperia Arc with 2.3.4, the Html viewer comes up, and the window says > "Web page not available".
> It also contains a link that is differnet from what was specified by the > intent, something like "content://com.android.htmlfileprovider/<file path > here>?text/html".
> On an HTC Incredible S it's working now, but I received an OTA firmware > update just recently, and before then, it was also broken.
> It's also broken on my Galaxy Nexus with 4.0.2, so the fix on the > Incredible S was made by HTC just for their own firmwares.
> On the devices where this fails, an almost identical link but without the > embedded (and encoded) space works just fine.
> -- K
> On 04/19/2012 12:11 AM, Justin Anderson wrote:
> Jovish, you need to ask these questions elsewhere (like StackOverflow or >> the Android Developers list).
> *The "water cooler" of Android discussion. You can discuss just about > anything Android-related here, ideas for the Android platform, > announcements about your applications, discussions about Android devices, > community resources... As long as your discussion is related to Android, > it's on-topic here. > * > But the OP should also be aware that it also says "*However, if you have > a discussion here that could belong on another list, you are probably not > reaching all of your target audience here and may want to consider shifting > to a more targeted list."*
>> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscribe@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en
> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en