Finishing an Activity in Android
<p>When you press the back button while in an activity, by default, does the application not go back to the activity that called it? I am calling an activity in my application(call it Activity B), from Activity A, but when I hit the back button while in Activity B, I am taken back to the main page of the application. </p>

<p>So I guess in general, does pushing the back button on your phone take you to the calling activity?</p>

<p>Calling activity B from within an inner class of activity A:</p>

<pre><code>    class HeadlineButtonListener implements OnClickListener {

    private Story story;

    public HeadlineButtonListener(Story story) {
        this.story = story;
    }

    @Override
    public void onClick(View v) {
        Intent myIntent = new Intent(HeadlineBoard.this, StoryView.class);
        myIntent.putExtra(Constants.STORY_EXTRA, story);
        HeadlineBoard.this.startActivity(myIntent);
        finish();

    }
}
</code></pre>
