title: Share button is not clickable in Android Webview App
body: <p>I am trying to add share functionality to my webview app but unable to get it to work properly. I am able to show the icon and there aren't any errors as well but still the share button is not clickable. I am searching for 2 days but got nothing working instead of different tutorials for implementing share functionality. Although this one shows no error but, this just doesn't work.</p>
  
  <p>My Java File</p>
  
  <pre><code>import android.content.Intent;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v4.widget.SwipeRefreshLayout;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.ShareActionProvider;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.support.v4.view.MenuItemCompat;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.ShareActionProvider;
  
  public class MainActivity extends AppCompatActivity {
      private WebView YoWeb;
      private ShareActionProvider mShareActionProvider;
  
      SwipeRefreshLayout swipe;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          swipe = (SwipeRefreshLayout) findViewById(R.id.swipe);
          swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
              @Override
              public void onRefresh() {
                  LoadWeb();
              }
          });
          LoadWeb();
      }
  
      public void LoadWeb() {
          YoWeb = (WebView)findViewById(R.id.webview);
          WebSettings webSettings = YoWeb.getSettings();
          webSettings.setJavaScriptEnabled(true);
          YoWeb.loadUrl("website url");
          swipe.setRefreshing(true);
          YoWeb.setWebViewClient(new WebViewClient() {
  
              //onPageFinished Method
              public void onPageFinished(WebView view, String url) {
                  //Hide the SwipeRefreshLayout
                  swipe.setRefreshing(false);
              }
          });
      }
  
      @Override
      public void onBackPressed() {
          if (YoWeb.canGoBack()) {
              YoWeb.goBack();
          } else {
              super.onBackPressed();
          }
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate menu resource file.
          getMenuInflater().inflate(R.menu.menu_main, menu);
  
          // Locate MenuItem with ShareActionProvider
          MenuItem item = menu.findItem(R.id.menu_item_share);
  
          // Fetch and store ShareActionProvider
          mShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
  
          // Return true to display menu
          return true;
      }
  
      // Call to update the share intent
      private void setShareIntent(Intent shareIntent) {
          if (mShareActionProvider != null) {
              mShareActionProvider.setShareIntent(shareIntent);
          }
      }
  }
  </code></pre>
  
  <p>Main Menu Layout File</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  tools:context="com.yoalfaaz.yoalfaaz.MainActivity"&gt;
  
  &lt;item
      android:id="@+id/menu_item_share"
      android:showAsAction="ifRoom"
      android:title="Share"
      app:actionProviderClass="android.support.v7.widget.ShareActionProvider"
      app:showAsAction="always" /&gt;
  &lt;item
      android:id="@+id/action_settings"
      android:orderInCategory="100"
      android:title="@string/action_settings"
      app:showAsAction="never" /&gt;
  </code></pre>
  
  <p></p>