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

  • SEARCH
  • Home
  • 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 8015137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:09:57+00:00 2026-06-04T20:09:57+00:00

I have an activity which is displaying a web page using a WebView. Within

  • 0

I have an activity which is displaying a web page using a WebView. Within that page, there is a link to a YouTube video (so it’s not a video I can or need to embed).

The problem is that the video won’t play – I can see the video preview image with a click icon, but clicking it has no response. Is there anything that can be done?

public class DisplayWebPage extends Activity
{   
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.display_web_page);

        Bundle extras = getIntent().getExtras();
        String url = extras.getString("url");
        WebView webview = (WebView)findViewById(R.id.WebView1);

        webview.setWebViewClient(new WebViewClient());
        webview.getSettings().setJavaScriptEnabled(true);
        webview.loadUrl(url);
    }
}
  • 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-04T20:09:59+00:00Added an answer on June 4, 2026 at 8:09 pm
    public class MyPdfViewActivity extends Activity {
    
      @Override
      protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        WebView mWebView=new WebView(MyPdfViewActivity.this);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setPluginsEnabled(true);
        mWebView.loadUrl(youtube_link);
        setContentView(mWebView);
      }
    }
    

    Update::
    If the above doent work then try the below::

    public class main extends Activity {
        /** Called when the activity is first created. */
         @ Override
    
    
         public void onCreate (Bundle savedInstanceState) {
             super. onCreate (savedInstanceState);
    
    
    
             setContentView (R.layout.main);
    
             WebView web = (WebView) findViewById (R.id.webView);
             web. getSettings().setJavaScriptEnabled (true); 
             web. getSettings().setJavaScriptCanOpenWindowsAutomatically (false);
             web. getSettings().setPluginsEnabled (true);
             web. getSettings().setSupportMultipleWindows (false);
             web. getSettings().setSupportZoom (false);
             web. setVerticalScrollBarEnabled (false);
             web. setHorizontalScrollBarEnabled (false);
    
    
             web. loadUrl ("THE URL TO YOUR WEBVIEW SITE SHOULD GO HERE");
    
             web. setWebViewClient (new WebViewClient () {
                 @ Override public boolean shouldOverrideUrlLoading(WebView view, String url) {
                 if (url.startsWith("vnd.youtube")){
    
                 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
    
                 return true;
                 }
                 else
                 {
                 return false;
                 }
                 }
             });
         }
    
     } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one activity which i am using for displaying Dialogs and as a
I have an activity that is a service which plays audio using a media
I have an activity which consists of a ListView . The problem is that
I have an Activity class which has an attribute that references an AsyncTask instance
friends, i have a page on which i am displaying image from gallery then
I have one activity which download data from the web. In middle of the
I have an activity which is displaying walking directions as text. I have a
I have an activity which shows some List entries. When I click on a
I have an activity which needs to make two remote server calls. The first
I have an activity which uses two Loaders. Each of them returns different type

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.