OnCreate Calls After OnPause in Android
<p>I am developing an app in which i have create three activities </p>

<ul>
<li>Main_Activity</li>
<li>Second_Activity</li>
<li>CustomView_Activity</li>
</ul>

<p>Here is the process in which these Activties called:</p>

<ul>
<li>MainActivity calls Second_Activtiy and in OnCreate of Second_Activtiy I have created object of CustomView_Activity.</li>
<li>In Main_Activity I have a button on a LinearLayout which onClick calls Second_Activity in Second_activity OnCreate i have to keep my Screen On and and declare other things like buttons layouts etc.</li>
<li>In CustomView_Activity i have creates canvas and onCanvas i have draw a Rectangle.</li>
<li><p>Now when my Second_Activity calls after Main_Activity and calling OnPause on pressing Power button my activity calls </p>

<pre><code>OnPause -&gt; OnStop -&gt; OnCreate -&gt; OnResume -&gt; OnRestart -&gt; OnDestroy
</code></pre>

<p>and when I press the power button to on the screen <code>OnResume -&gt; onCreate -&gt; OnRestart</code> calls.</p></li>
</ul>

<p>Due to calling of OnCreate again and again my activity not performing tasks correctly.</p>

<p>Please anyone who can help??</p>
