Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8995287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:35:59+00:00 2026-06-15T23:35:59+00:00

I am trying to open a url in my webview but the problem is

  • 0

I am trying to open a url in my webview but the problem is that the url is not loading in my webview, its showing pop-up for the selection of browser and as soon as i click on an option it opens the url in that browser. Can somebody help me to solve this, i want the url to open in the webview itself not in the browser.

my xml for webview is :-

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bg_new" >

    <RelativeLayout
        android:id="@+id/upBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <ImageView
            android:id="@+id/header"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <ImageView
            android:id="@+id/wbview_bckbtn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/back_btn_chng" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/upBar" >

        <WebView
            android:id="@+id/linkwebview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="10dp"
            android:scrollbars="none" />
    </RelativeLayout>

</RelativeLayout>

and here’s my code for webview :-

public class FbTwtrLink extends Activity {

    WebView web;
    ImageView img,bckimg,share_btn; 

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fb_twtr_link);

        img = (ImageView)findViewById(R.id.header);
        bckimg = (ImageView) findViewById(R.id.wbview_bckbtn);

        web=(WebView)findViewById(R.id.linkwebview);
        web.getSettings().setJavaScriptEnabled(true);

        web.loadUrl("http://www.google.com");

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_fb_twtr_link, menu);
        return true;
    }

}

and i m calling the webview like that :-

fbicon.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub


                Intent intent=new Intent(context,FbTwtrLink.class);
                //intent.putExtra("fb_link", 1);
                startActivity(intent);
            }
        });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:36:00+00:00Added an answer on June 15, 2026 at 11:36 pm

    You should override WebViewClient and its method shouldOverrideUrlLoading

     web.setWebViewClient(new MyWebClient()); 
     web.loadUrl("http://www.google.com");
    
    class MyWebViewClient extends WebViewClient {
      @Override
      // show the web page in webview but not in web browser
       public boolean shouldOverrideUrlLoading(WebView view, String url) {
        //1 option 
        // getApplicationContext().startActivity(
        // new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
        // 2 option
        //view.loadUrl(url);
            return true;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to open an url http://الاعلي-للاتصالات.قطر/ar/news-events/event/future-internet-privacy with the urllib2.urlopen but it reports always
I'm trying to open that url with codeigniter: http://example.com/controller/function/land-for-sale-6350-m2-40k-euro-is-that-too-much-?-ad-code:608/54990 here is the error i've
I am trying to get data from editText box and open that url on
I´m trying to open an URL with UIApplication, but when I run: [[UIApplication sharedApplication]
I am trying to programmatically (Java) open a URL that points to a modem
Iam trying to Open a URL in New Browser Tab by passing it to
I am not sure if this is possible, but I am trying to open
I am trying open a new window using url.Action. And the new Window url
I'm trying the open a relative path in Ubuntu , but after opening the
I'm trying to open a zip file with jython using FileInputStream and ZipInputStream. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.