android volatile variable in BroadcastReceiver
<p>i have </p>

<pre><code>public class ScreenReceiver extends BroadcastReceiver {

private volatile boolean wifiNetwork = false;
private volatile boolean mobileNetwork = false;

}
</code></pre>

<p>and i am cheking boolean variable all the time receiver is executed. Is it smart to use <code>volatile</code> variable here or not? I don't have any thread but i always want the latest state of this variable.</p>
