Getting StackOverflowError when trying to call an activity from another
<p>I am trying to develop a small app BusTracker which will list down a list of buses when you mention the from and to places.
I have a frombutton which when clicked will call another activity(which is a listactivity) that will show a list of places. I choose one and the place gets saved and textfield in the firstActivity gets populated with that. I'm getting stackOverFlowerror in the oncreate method of the second activity. can anyone pls give me a possible reason for this?</p>

<p>Here is my code in the firstActivity onClick method</p>

<pre><code>case R.id.from_button:
Intent i= new Intent(this,PlacesActivity.class);
startActivity(i);
String ss=PlacesActivity.getPlace();
</code></pre>

<p>Then in the secondActivity</p>

<pre><code>this.onCreate(onSavedInstanceState);
    setContentView(R.layout.places);
     ListView placesList=(ListView)this.findViewById(R.layout.places);

     placesList.setVisibility(View.VISIBLE);
     placesList.setAdapter(new ArrayAdapter(this,R.array.fromArray));
     placesList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
     //placesList.setOnItemClickListener(this);

}

public void onListItemClick(ListView l, View v, int position, long id)
{
    Object o=this.getListAdapter().getItem(position);
    String s=o.toString();
    place=s;
    System.out.println("sssssssssssss"+s);
}
</code></pre>

<p>Error I get:</p>

<pre><code>03-10 18:02:46.352: E/AndroidRuntime(542): FATAL EXCEPTION: main
03-10 18:02:46.352: E/AndroidRuntime(542): java.lang.StackOverflowError
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
03-10 18:02:46.352: E/AndroidRuntime(542):  at com.example.BusTracker.PlacesActivity.onCreate(PlacesActivity.java:17)
</code></pre>
