Alberto wrote: > this is my class, where is the problem? > the error message is "the application [...] has stopped unexpectedly". > HELP > > public class asd extends Activity { > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle icicle) { > super.onCreate(icicle); > > try{ > WebView wv = new WebView(this); > wv.loadUrl("/sdcard/index.html"); > setContentView(wv); > } > catch(Exception e){ > TextView t = new TextView(this); > t.setText(e.getMessage()); > this.setContentView(t); > } > } > } > > P.S. The index.html had been correctly inserted into sdcard.
Starting with the 0.9 SDK, you cannot load static files off the phone (or, apparently, SD cards) into WebView. The stated reason is security. You can attempt to read the file in yourself and use loadData() instead of loadUrl() to put the information into the WebView, though it appears that approach has limitations when it comes to links and image references. -- Mark Murphy (a Commons Guy) http://commonsware.com Warescription: All titles, revisions, & ebook formats, just $35/year --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---