Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not 100% clear on your issue. Whether its the data issue, or the screen issue. (Or if the screen issue is what you are doing to try and fix the data issue?).</p> <p><strong>For the screen</strong></p> <p>You are not using the right lock to keep the screen on. <code>PARTIAL_WAKE_LOCK</code> only requests that you can use the processor. To keep the screen on your app use one of <code>SCREEN_DIM_WAKE_LOCK</code>, <code>SCREEN_BRIGHT_WAKE_LOCK</code> or <code>FULL_WAKE_LOCK</code> depending on what you want. This lock should be held for as long as you need the lock. Currently you are releasing it in onCreate(). Keep in mind that if the user presses the power button though that your lock is released (with PARTIAL being the exception to this).</p> <p>If your intent is just to keep the screen on when a view is active then it's better not to use the lock at all. The wake lock needs an extra permission. You can do it by adding this to your <code>onCreate</code> override:</p> <pre><code>getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); </code></pre> <p>This is the same effect as using <code>android:keepScreenOn="true"</code>, which you already seem to be doing. I can't however tell why that isn't working from your snippets. Make sure you are inflating the right layout.</p> <p><strong>For your data</strong></p> <p>The device will likely be switching off 3G data when the screen is not active (and no lock is present). Again, don't release your lock if you need it (Though don't keep it forever either, that's just going to suck up phone battery).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload