title: Android Share Menu
body: <p>I have an app in which I have a WebView where I display some websites.
  I want create a Share button in Menu.I've tried a lot of code. </p>
  
  <p>What should I write here ?</p>
  
  <pre><code>private void action_shareMenuItem(){
  
  //??????????????? What should I write here ?
  
  }
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>package com.kefelon.goldplak;
  
  import android.app.AlertDialog;
  import android.content.DialogInterface;
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.support.v7.widget.ShareActionProvider;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.webkit.WebChromeClient;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.widget.ProgressBar;
  
  
  public class MainActivity extends ActionBarActivity {
   WebView webview;
      private ShareActionProvider mShareActionProvider;
      ProgressBar loadingProgressBar;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          webview = (WebView) findViewById(R.id.webview);
          webview.getSettings().setSupportZoom(true);
          webview.getSettings().setJavaScriptEnabled(true);
          webview.loadUrl("http://www.goldplak.com");
          webview.setWebViewClient(new WebViewClient() {
          });
  
          loadingProgressBar=(ProgressBar)findViewById(R.id.progressbar_Horizontal);
  
          webview.setWebChromeClient(new WebChromeClient() {
  
              // this will be called on page loading progress
  
              @Override
  
              public void onProgressChanged(WebView view, int newProgress) {
  
                  super.onProgressChanged(view, newProgress);
  
  
                  loadingProgressBar.setProgress(newProgress);
                  //loadingTitle.setProgress(newProgress);
                  // hide the progress bar if the loading is complete
  
                  if (newProgress == 100) {
                      loadingProgressBar.setVisibility(View.GONE);
  
                  } else{
                      loadingProgressBar.setVisibility(View.VISIBLE);
  
                  }
  
              }
  
          });
  
      }
  
  
  
      @Override
      public void onBackPressed()
      {
          if(webview.canGoBack()){
              webview.goBack();
          }else{
              new AlertDialog.Builder(this)
                      .setIcon(android.R.drawable.ic_dialog_alert)
                      .setTitle("Çıkış")
                      .setMessage("Uygulamadan çıkmak istediğinize emin misiniz?")
                      .setPositiveButton("Evet", new DialogInterface.OnClickListener()
                      {
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              finish();
                          }
  
                      })
                      .setNegativeButton("Hayır", null)
                      .show();
          }
      }
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          super.onOptionsItemSelected(item);
          switch(item.getItemId()) {
              case R.id.action_about:
                  action_aboutMenuItem();
                  break;
              case R.id.action_share:
                  action_shareMenuItem();
                  break;
              case R.id.action_settings:
                  action_settingsMenuItem();
                  break;
          }
          return true;
      }
  
  
  
  
      private void action_aboutMenuItem(){
      new AlertDialog.Builder(this)
              .setTitle("Hakkımızda")
              .setMessage("Gold Plak olarak müzik sektörü ile ilgili müşteri odaklı kişisel ve kurumsal hizmet veren, dinamik, güler yüzlü, yaratıcı kadromuzla müşterilerimizin beklentilerini karşılamak için kesintisiz hizmet vermekteyiz.\n" +
                      "\n" +
                      "Bu şekilde müşterilerimizin plak ve dj ekipmanlarından yararlanmalarını sağlayarak taleplerini karşılayabilmek. Hedefimiz, yeni çıkan tüm ürünleri sunmak, maksimum düzeyde müşteri memnuniyetini sağlamak..")
    .setNeutralButton("Tamam", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
  
        }
    }).show();
      }
  
  
      private void action_shareMenuItem(){
  
          //??????????????? What should I write here ?
  
  
  
      }
  
  
       private void action_settingsMenuItem(){
      new AlertDialog.Builder(this)
              .setTitle("Versiyon")
              .setMessage("Gold Plak v1.1")
              .setNeutralButton("Tamam", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
  
                  }
              }).show();
  }
  
  
      }
  </code></pre>