Thanks Dave. I am trying to use the example you mentioned
(ElementProvider).
This is how I use it.
ContentValues values = new ContentValues();
values.put("KEY_DATA", "/demo.html");
ElementProvider ep = new ElementProvider();
Uri uri = ep.CONTENT_URI;
myuri = ep.insert(uri, values); // Here I face the problem
ParcelFileDescriptor pfd ;
try{
pfd = ep.openFile(uri, "rw");
}
catch(FileNotFoundException e){
Log.v("test", "File not found");
}
when I debug, I see that in the insert method, " SQLiteDatabase mDb
= mDbH.getWritableDatabase();" is failing. (mDbH is null)
What could be the problem?
If someone has used it, please let me know.
Thanks
On Oct 16, 7:52 pm, schmielson <[EMAIL PROTECTED]> wrote:
> Hey Rubicks,
>
> Check out this
> thread:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> WebView does not support file:/// URLs.
>
> Best,
> Dave
>
> On Oct 15, 5:47 pm, Rubicks <[EMAIL PROTECTED]> wrote:
>
> > May be this is what you meant? myActivityLauncher is an Activity
> > where I have a webview to load html file from sdcard.
> > public void startMyActivityLauncher() {
> > Intent i = new Intent(this, myActivityLauncher.class);
> > i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
> > i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
> > i.addFlags(Intent. FLAG_GRANT_WRITE_URI_PERMISSION);
> > i.setFlags(Intent. FLAG_GRANT_WRITE_URI_PERMISSION);
> > startActivity(i);
> > }
> > It doen't work either. What am I missing here?
>
> > On Oct 16, 1:08 am, Rubicks <[EMAIL PROTECTED]> wrote:
>
> > > ok. I have a webview which is used just by my application. Now, how
> > > do I give permission? Is it done in Androidmanifest file? If that is
> > > the case, I have already done that
> > > <uses-permission android:name="android.permission.INTERNET" />
>
> > > On Oct 16, 12:50 am, Mike Reed <[EMAIL PROTECTED]> wrote:
>
> > > > The Browser app does not have permission to load a page from the SD
> > > > card. You can write an app with a WebView, and give yourself that
> > > > permission, but the Browser is built explicitly w/o that right for
> > > > security reasons.
>
> > > > On Oct 15, 2008, at 3:41 PM, Rubicks wrote:
>
> > > > I am trying to get a html file stored in my sdcard image on to
> > > > webview .
> > > > I am doing something like this
>
> > > > myWebView.loadUrl("/sdcard/index.html");
>
> > > > Then I get an error on the webview as "The webpage at
> > > > file:///sdcard/index.html
> > > > could not be loaded as: The requested file was not found."
> > > > But I am sure I have "index.html " on my sdcard image and it is
> > > > available to the emulator. Because I see it on the File explorer.
> > > > I tried myWebView.loadUrl("file:///sdcard/index.html"); as well. Still
> > > > the same problem exists.
>
> > > > If I have to use "loadDataWithBaseUrl()", then I think, I need to
> > > > convert index.html to a string, which I don't want to.
>
> > > > I could not figure out the problem.
>
> > > > Any one any thoughts?
>
> > > > Thanks.
>
> > > > On Oct 3, 8:37 pm, schmielson <[EMAIL PROTECTED]> wrote:
>
> > > > > Thanks a ton for your comments, Mark. I've filed a
> > > > > bug:http://code.google.com/p/android/issues/detail?id=929
> > > > > .
>
> > > > > Best,
> > > > > Dave
>
> > > > > On Oct 1, 5:29 am, Mark Murphy <[EMAIL PROTECTED]> wrote:
>
> > > > >> schmielson wrote:
> > > > >>> As it turns out, the android:layout_height="wrap_content" used along
> > > > >>> with android:layout_weight="1" of the WebView was preventing the
> > > > >>> WebView from properly receiving events! After changing the
> > > > >>> WebView's
> > > > >>> layout_height attribute to "0px" instead of "wrap_content",
> > > > >>> shouldOverrideUrlLoading is being called and things work like a
> > > > >>> charm. This bug was particularly insidious, however, since I never
> > > > >>> would have expected that these attributes would have altered the
> > > > >>> view's ability to process clicks/touches in this way.
>
> > > > >> That is definitely strange. There might be a method to the madness
> > > > >> there, but off the cuff, I don't see it.
>
> > > > >>> Do you think this is an SDK bug or a documentation bug?
>
> > > > >> Ummm...yes. ;-)
>
> > > > >> In other words, it depends a little on why it's not working. The fact
> > > > >> that you not only see the WebView, but can interact with it,
> > > > >> suggests to
> > > > >> me it's an SDK bug. However, one man's SDK bug can be an Android team
> > > > >> member's documentation bug, if this is somehow expected behavior.
>
> > > > >> I do recommend filing a bug, though, just to get this in the queue to
> > > > >> get looked at.
>
> > > > >> --
> > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > > >> Android Training on the Ranch! -- Mar 16-20,
> > > > >> 2009http://www.bignerdranch.com/schedule.shtml
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---