How to back without press "back" button
<p>I'm writing a project to read pdf files. My main class uses this code to call the <code>ReaderActivity</code> class:</p>

<pre><code>Intent it = new Intent(this, ReaderActivity.class);
startActivity(it);
</code></pre>

<p>And the <code>ReaderActivity</code> class is like below to read pdf files:</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    String mimetype = "application/pdf";
    File file = new File(filepath);
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(file), mimetype);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);
}
</code></pre>

<p>When I successfully open the pdf, I press the "back" button and the view is black. When I press "back" again, it returns to the main class view. When the pdf opens, I want to press "back" button one time and return to the main class view. How can I do this?</p>
