-4

I am new in android development, after crawling on Google, I'm here for best hope...

I am trying to open html files which are in assets folder on listview item click how to do this?

I want to open new activity which contains a webview object but different html file according to listview Item.

suppose list view items are chapter 1 ,chpater 2, chapter 3 then when i click on chapter 2 it should be open chapter2.html and when i click on chapter 1 it should be open chpater1.html and so on..

please i really need help on this topic

thanks in advance..

Dan Beaulieu
  • 19,406
  • 19
  • 101
  • 135
  • what have you done so far? what is not working? – Lamorak May 05 '15 at 12:26
  • @Lamorak I have created new activity with webview and xml file where i can display html file but i can only open one html file i want all html file to open in single activity – Pradip Gangoda May 06 '15 at 16:08

1 Answers1

0

Webview load html from assets directory

Please check this question and also when you click on any of the list item you can simply pass item id or position to your webview page or you can also rename your html files according to your list item it .

hope you understand !!

Happy coding !!

Community
  • 1
  • 1
Madhav Anadkat
  • 56
  • 1
  • 15
  • Just go to above link which i have given to you !! there is a code ! ! public class ViewWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.webview); WebView wv; wv = (WebView) findViewById(R.id.webView1); wv.loadUrl("file:///android_asset/aboutcertified.html"); // now it will not fail here } } – Madhav Anadkat May 07 '15 at 10:32