Thank you @Emanuel Moecklin
its work for me here

Em quinta-feira, 1 de setembro de 2011 14:37:52 UTC-3, Emanuel Moecklin 
escreveu:
>
> Much easier and faster: 
> webView.loadUrl("file:///android_asset/test1.html"); 
>
> As TreKing pointed out, relative links work well: 
> <a href="test2.html">Click Me</a> 
> If you really need absolute links: 
> <a href="file:///android_asset/test2.html">Click Me</a> 
>
> Emanuel 
> 1gravity LLC 
>
> On Aug 31, 3:03 pm, Harshani <[email protected]> wrote: 
> > I am new to Android. 
> > 
> > I want to display HTML pages in android emulator. I put my 
> > "test1.html" and "test2.html" files in the "assets" folder and managed 
> > to display "test1.html" file in Android by using the following code. 
> > 
> > package com.example.helloandroid; 
> > 
> > import java.io.IOException; 
> > import java.io.InputStream; 
> > 
> > import android.app.Activity; 
> > import android.os.Bundle; 
> > 
> > public class Test extends Activity { 
> > 
> >     @Override 
> >     public void onCreate(Bundle savedInstanceState) { 
> >         super.onCreate(savedInstanceState); 
> >         WebView webview = new WebView(this); 
> >         setContentView(webview); 
> > 
> >         try { 
> > 
> >             InputStream fin = getAssets().open("test1.html"); 
> >                 byte[] buffer = new byte[fin.available()]; 
> >                 fin.read(buffer); 
> >                 fin.close(); 
> >                 webview.loadData(new String(buffer), "text/html", 
> > "UTF-8"); 
> > 
> >         } catch (IOException e) { 
> >             e.printStackTrace(); 
> >         } 
> >     }} 
> > 
> > Now I want to click a button or a link in the "test1.html" file and 
> > open the "test2.html" file.How can I link those two HTML pages? 
> > 
> > Thanks in advance. 
> > 
> > Regards, 
> > 
> > Harshani

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/3c0d8e24-fa08-47e7-afb9-73df5e642f3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to