title: How to "save" string variable from settings menu
body: <p>I'm new about coding so i'm sorry for my "basic" questions.</p>
  
  <p>I'm coding an Android app with Android studio; very simple, only webview that show my website but i need to have in settings menu an editText where i can modify my website url.</p>
  
  <p>I made two activitys(Main and Settings) that i post; Could anyone help me to understand how can i store permanently the url that i write in my editText in order to open that url when i came back to main activity?
  Hope i submit clearly my question!!
  Thanks in advance</p>
  
  <pre><code>Settings.java
  private EditText editsite;
      private Button button;
      public static TextView actSite;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_settings);
  
          editsite = findViewById(R.id.editsite);
          button = findViewById(R.id.saveButton);
          actSite = findViewById(R.id.actSite);
          button.setOnClickListener(this);
  
      }
  
  
              @Override
              public void onClick(View view) {
              String strData = editsite.getText().toString();
              if (strData.length()&lt;=0) {
                  Toast.makeText(this,"Sito non valido", Toast.LENGTH_SHORT).show();
              }else {
                  actSite.setText(strData);
  </code></pre>
  
  <pre><code>Main Activity.java
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          WebView vista = (WebView)findViewById(R.id.vista);
  
          vista.getSettings().setJavaScriptEnabled(true);
  
          vista.setWebViewClient(new WebViewClient());
  
  
         vista.loadUrl("www.google.com");  //examplesite
  
      }
  
      @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) {
          // 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) {
              Intent intent = new Intent(MainActivity.this, Settings.class);
              startActivity(intent);
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
  }
  
  </code></pre>