Thanks.
I changed the code to this and it works
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class hmm extends Activity {
WebView mWebView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl)
{
// Handle the error
}
@Override
public boolean shouldOverrideUrlLoading(WebView view,
String url)
{
view.loadUrl(url);
return true;
}
});
mWebView.loadUrl("http://twitter.com/intent/tweet?text=just+got
+a+hiscore");
}
}
On May 13, 1:03 pm, Mark Murphy <[email protected]> wrote:
> On Fri, May 13, 2011 at 12:53 PM, bob <[email protected]> wrote:
> > When I do this,
>
> > mWebView.loadUrl("http://www.google.com/");
>
> > the web page loads in the view.
>
> I doubt it. This usually pops up the user's choice of browser, due to
> a redirect.
>
> > However, when I do this:
>
> > mWebView.loadUrl("http://twitter.com/intent/tweet?text=just+got+a
> > +hiscore");
>
> > it tries to pop up a whole new window.
>
> > Anyone know why this is?
>
> Because of a redirect. Use WebViewClient and
> shouldOverrideUrlLoading() to manage redirect behavior.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 3.0 Programming Books:http://commonsware.com/books
--
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