title: how to get a result from current activity and then get back to the previous one
body: <p>I have five activities for the different country.like, India, Sri Lanka, Argentina, America, China and each activity contains place picker activity to pick a current place.</p>
  
  <p>When I press a button on the India activity, the place picker activity is launched.and pick the location and display this location on India activity.like this when i press a button on Argentina activity, the place picker activity is launched.and pick the location and display this location on Argentina activity.</p>
  
  <p>for this, I want to send some data back to the previous screen. I used the shared preferences, but when I pick the location from any activity it always displays data in India activity instead of previous activity from which I launched the place picker activity.</p>
  
  <p>in short, I need to get a result from this Place picker Activity and then get back to the previous one.</p>
  
  <p><strong>below is code where i send my data from place picker</strong></p>
  
  <pre><code>   CharSequence city = place.getName();
     CharSequence cityAddress = place.getAddress();
  
              SharedPreferences settings = getSharedPreferences("city_address", Context.MODE_PRIVATE);
              SharedPreferences.Editor editor = settings.edit();
              editor.putString("city_address", (String) cityAddress);
              editor.putString("city_name", (String) city);
              editor.commit();
  
              Intent intent = new Intent(this, India.class);
              startActivity(intent);
  </code></pre>
  
  <p><strong>and this is code in each activity to display data</strong></p>
  
  <pre><code>  SharedPreferences settings = getSharedPreferences("city_address", Context.MODE_PRIVATE);
      String n = settings.getString("city_name", "");
      String a = settings.getString("city_address", "");
      cityname.setText(n);
      cetlocation.setText(a);
  </code></pre>
  
  <p>I've read about the StartActivityForResult() method, but I'm not yet sure how to use it properly, any examples?please help me I am new to the android studio.</p>