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 6597989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:16:51+00:00 2026-05-25T18:16:51+00:00

I am trying to load web view in to dialog. I am usuing the

  • 0

I am trying to load web view in to dialog. I am usuing the following code.

    final TextView seeMonthlyBill = (TextView) parentLayout
            .findViewById(R.id.my_ac_my_service_timewarnercable_link);
    seeMonthlyBill.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            Dialog dialog = new Dialog(getActivity());
            WebView wb = new WebView(getActivity());
            wb.getSettings().setJavaScriptEnabled(true);
            wb.loadUrl("http://www.google.com");
            wb.setWebViewClient(new HelloWebViewClient());
            dialog.setCancelable(true);
            dialog.setContentView(wb);
            dialog.setTitle("WebView");
            dialog.show();
        }
    });

I want to open web view on the click on a text view. When i am clicking on the text view dialog is opening without the webview. Can any please help me to solve this issue.

Thanks in advance.

  • 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-05-25T18:16:51+00:00Added an answer on May 25, 2026 at 6:16 pm

    Use a XML layout containing a Webview.
    Then call dialog.setContentView(R.layout.web_dialog)

    Set up the webview afterwards like so:
    WebView wv = (WebView) findViewById(R.id.webview);
    “R.id.webview” being the ID in the XML Layout file.

    Dialog Layout example:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    >
        <WebView
            android:id="@+id/webview"
            android:scrollbars="vertical"
            android:scrollbarAlwaysDrawVerticalTrack="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true" />
    </LinearLayout>
    

    Your code modified:

    final TextView seeMonthlyBill = (TextView) parentLayout
                .findViewById(R.id.my_ac_my_service_timewarnercable_link);
        seeMonthlyBill.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Dialog dialog = new Dialog(getActivity());
                dialog.setContentView(R.layout.web_dialog)
                WebView wb = (WebView) dialog.findViewById(R.id.webview);
                wb.getSettings().setJavaScriptEnabled(true);
                wb.loadUrl("http://www.google.com");
                wb.setWebViewClient(new HelloWebViewClient());
                dialog.setCancelable(true);
                dialog.setTitle("WebView");
                dialog.show();
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my app in a web view page i am trying to load images
I have one web view and I am trying to load a dynamic page
So I'm trying to load a simple URL (http://www.google.com) into a web view. I
i am trying to load some web pages in web view of my android
I am trying to load a google web toolkit application with django, but the
We are trying to load a pdf file in web browser using pdfobject javascript
I am trying to load a mobile version of the web page using a
I am trying to load a cron job on my web-server. I want it
I'm trying to write a simple load tester for one of our web services,
i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine

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.