title: WebView with SharedPreferences
body: <p>I store my SharedPreference, but I don't know how to use it in a webview. 
  In fact, I want to address that, depending on stored in the webview, it makes a request of <a href="http://myurlsharedpreference.com/mypage" rel="nofollow">http://myurlsharedpreference.com/mypage</a> kind. So I want http: // myurlsharedpreference be added to / mypage and that everything displays a webview, it is possible and if so how are my variables to store:</p>
  
  <p>public class Settings extends Activity implements OnClickListener {</p>
  
  <pre><code>CheckBox checkBox;
  EditText editText;
  Button button;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.settings);
  
      checkBox = (CheckBox) findViewById(R.id.checkBox1);
      editText = (EditText) findViewById(R.id.editText1);
      button = (Button) findViewById(R.id.button1);
      button.setOnClickListener(this);
      loadSavedPreferences();
  }
  
  private void loadSavedPreferences() {
      SharedPreferences sharedPreferences = PreferenceManager
              .getDefaultSharedPreferences(this);
      boolean checkBoxValue = sharedPreferences.getBoolean("CheckBox_Value", false);
      String name = sharedPreferences.getString("storedName", "YourName");
      if (checkBoxValue) {
          checkBox.setChecked(true);
      } else {
          checkBox.setChecked(false);
      }
  
      editText.setText(name);
  }
  
  private void savePreferences(String key, boolean value) {
      SharedPreferences sharedPreferences = PreferenceManager
              .getDefaultSharedPreferences(this);
      Editor editor = sharedPreferences.edit();
      editor.putBoolean(key, value);
      editor.commit();
  }
  
  private void savePreferences(String key, String value) {
      SharedPreferences sharedPreferences = PreferenceManager
              .getDefaultSharedPreferences(this);
      Editor editor = sharedPreferences.edit();
      editor.putString(key, value);
      editor.commit();
  }
  
  @Override
  public void onClick(View v) {
      // TODO Auto-generated method stub
      savePreferences("CheckBox_Value", checkBox.isChecked());
      if (checkBox.isChecked())
          savePreferences("storedName", editText.getText().toString());
  
      finish();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Seccond Activity ( where i want when a button is clicked ) </p>
  
  <pre><code>public class SecondActivity extends Activity {
  
      ImageButton imageButton;
      ImageButton imageButton2;
      ImageButton imageButton3;
      ImageButton imageButton4;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.home);
          addListenerOnButton();
          addListenerOnButton2();
          addListenerOnButton3();
          addListenerOnButton4();
      } 
      public void addListenerOnButton() {
  
          imageButton = (ImageButton) findViewById(R.id.imageButton1);
  
          imageButton.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
  
                 Toast.makeText(SecondActivity.this,
                  "ImageButton is clicked!", Toast.LENGTH_SHORT).show();
  
              }
  
  
          });
  
      }
      public void addListenerOnButton2() {
  
          imageButton2 = (ImageButton) findViewById(R.id.imageButton2);
  
          imageButton2.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg1) {
  
                 Toast.makeText(SecondActivity.this,
                  "ImageButton2 is clicked!", Toast.LENGTH_SHORT).show();
  
  
              }
  
  
          });
  
      }
      public void addListenerOnButton3() {
  
          imageButton3 = (ImageButton) findViewById(R.id.imageButton3);
  
          imageButton3.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg2) {
  
                 Toast.makeText(SecondActivity.this,
                  "ImageButton3 is clicked!", Toast.LENGTH_SHORT).show();
  
              }
  
  
          });
  
      }
      public void addListenerOnButton4() {
  
          imageButton4 = (ImageButton) findViewById(R.id.imageButton4);
  
          imageButton4.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg3) {
  
                /* Toast.makeText(SecondActivity.this,
                  "ImageButton4 is clicked!", Toast.LENGTH_SHORT).show();
   */
                  WebView myWebView = (WebView) findViewById(R.id.webview);
                  String UsersURL = [taken from shared preferences];
                  String UsersURL = UsersURL+"/mypage";
                  myWebView.loadUrl(UsersURL);
              }
  
  
          });
  
      }
  </code></pre>