Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Unable to open Html file using intent in deafult browser
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jovish P  
View profile  
 More options Apr 18 2012, 4:13 am
From: Jovish P <android.f...@gmail.com>
Date: Wed, 18 Apr 2012 13:43:11 +0530
Local: Wed, Apr 18 2012 4:13 am
Subject: Unable to open Html file using intent in deafult browser

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Murphy  
View profile  
 More options Apr 18 2012, 8:59 am
From: Mark Murphy <mmur...@commonsware.com>
Date: Wed, 18 Apr 2012 08:59:55 -0400
Local: Wed, Apr 18 2012 8:59 am
Subject: Re: [android-developers] Unable to open Html file using intent in deafult browser
Hmmm... looks like Uri.fromFile() is not converting the space to %20
or +. Try doing that yourself and see if it helps.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Wolfson  
View profile  
 More options Apr 18 2012, 3:16 pm
From: Mike Wolfson <mwolf...@gmail.com>
Date: Wed, 18 Apr 2012 12:16:14 -0700 (PDT)
Local: Wed, Apr 18 2012 3:16 pm
Subject: Re: Unable to open Html file using intent in deafult browser

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nadeem Hasan  
View profile  
 More options Apr 18 2012, 3:29 pm
From: Nadeem Hasan <nha...@nadmm.com>
Date: Wed, 18 Apr 2012 12:29:22 -0700 (PDT)
Local: Wed, Apr 18 2012 3:29 pm
Subject: Re: Unable to open Html file using intent in deafult browser

Mike,

I think you are on the wrong list :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nadeem Hasan  
View profile  
 More options Apr 18 2012, 3:30 pm
From: Nadeem Hasan <nha...@nadmm.com>
Date: Wed, 18 Apr 2012 12:30:47 -0700 (PDT)
Local: Wed, Apr 18 2012 3:30 pm
Subject: Re: Unable to open Html file using intent in deafult browser

"*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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nadeem Hasan  
View profile  
 More options Apr 18 2012, 3:34 pm
From: Nadeem Hasan <nha...@nadmm.com>
Date: Wed, 18 Apr 2012 12:34:13 -0700 (PDT)
Local: Wed, Apr 18 2012 3:34 pm
Subject: Re: Unable to open Html file using intent in deafult browser
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Apr 18 2012, 4:11 pm
From: Justin Anderson <magouyaw...@gmail.com>
Date: Wed, 18 Apr 2012 14:11:29 -0600
Local: Wed, Apr 18 2012 4:11 pm
Subject: Re: [android-developers] Re: Unable to open Html file using intent in deafult browser

> Jovish, you need to ask these questions elsewhere (like StackOverflow or
> the Android Developers list).

According to http://developer.android.com/resources/community-groups.html,
this list is for ANYTHING related to Android.

*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."*

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kostya Vasilyev  
View profile  
 More options Apr 18 2012, 4:46 pm
From: Kostya Vasilyev <kmans...@gmail.com>
Date: Thu, 19 Apr 2012 00:46:20 +0400
Local: Wed, Apr 18 2012 4:46 pm
Subject: Re: [android-developers] Re: Unable to open Html file using intent in deafult browser

Getting back to the original issue: it's an Android bug.

Even if the space is encoded properly (as %20) it may not open in the
built-in HtmlViewer application on some devices.

This is from my own little app's logcat output:

04-19 00:38:53.939 I/MimeUtil(23624): Intent: Intent {
act=android.intent.action.VIEW
dat=file:///mnt/sdcard/download/test%202.html typ=text/html flg=0x80000 }
04-19 00:38:53.939 I/MimeUtil(23624): Resolved package
com.android.htmlviewer, name com.android.htmlviewer.HTMLViewerActivity

The original filename is "test 2.html".

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jovish P  
View profile  
 More options Apr 19 2012, 2:52 am
From: Jovish P <android.f...@gmail.com>
Date: Thu, 19 Apr 2012 12:22:28 +0530
Local: Thurs, Apr 19 2012 2:52 am
Subject: Re: [android-developers] Re: Unable to open Html file using intent in deafult browser

*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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »