How to call onCreate method in 1st activity after finishing 2nd activity(which is called by the 1st activity)
<p>I am a begginer in android. I have a simple code, where I am calling one activity from my 1st activity and in that 2nd activity I have a button on press of which 2nd activity is finished and 1st activity comes up. Is there any way to call the <strong>onCreate</strong> method in the 1st activity as the onCreate method is never called in the 1st activity(onResume is called always)? Do i have edit some thing in the manifest file.</p>

<p>Following is my Code</p>

<pre><code> public class Activity1 extends Activity {
  /** Called when the activity is first created. */

 TextView mTextView ;

 Button b1;
 static int count=0;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);



    mTextView = (TextView) findViewById(R.id.textView2);

    if (savedInstanceState == null) {
        mTextView.setText("Welcome to HelloAndroid!");
    } else {
        mTextView.setText("Welcome Back!");
        System.out.println("count------&gt;"+ count);
    }



    final Intent i = new Intent(this,activity2.class);
    b1 = (Button) findViewById(R.id.button1);
    b1.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {

            startActivity(i);

        }
    });

}


@Override
public void onResume() 
{
    super.onResume();
    System.out.println("inside Resume");
 }

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    // Checks the orientation of the screen
    if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
        Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
    } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
        Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
    }
}
    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
      super.onSaveInstanceState(savedInstanceState);

      savedInstanceState.putBoolean("MyBoolean", true);
      savedInstanceState.putDouble("myDouble", 1.9);
      savedInstanceState.putInt("MyInt", 1);
      savedInstanceState.putString("MyString", "Welcome back to Android");
      count++;
    }


    @Override
    public void onRestoreInstanceState(Bundle savedInstanceState) {
      super.onRestoreInstanceState(savedInstanceState);

      boolean myBoolean = savedInstanceState.getBoolean("MyBoolean");
      double myDouble = savedInstanceState.getDouble("myDouble");

      System.out.println("MyBoolean"+ myBoolean);
      System.out.println("myDouble"+ myDouble);
    }


}
</code></pre>

<p>and here is my 2nd activity which is called by the 1st activiy</p>

<pre><code>public class activity2 extends Activity{

TextView textview;
Button b1;
 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main2);

        textview = (TextView) findViewById(R.id.textView1);

        textview.setText("in activity2");

        b1 = (Button) findViewById(R.id.button1);

        b1.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                finish();
            }
        });
 }
}
</code></pre>

<p>Some one please help me
Thanks!</p>
