Thanks for reply, I just added the following line to make your code work.
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);

But in this way the screen stay on all time which i don't want!

On Monday, September 8, 2014 11:49:06 PM UTC+2, Al B wrote:
>
> Add this to your activity:
>
> @Override
>     public void onCreate(Bundle savedInstanceState) {
>         wakeLock_ = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "
> MainActivity");
>     }
>     
>     @Override
>     protected void onStart() {
>         super.onStart();
>         wakeLock_.acquire();
>     }
>
>     
>     @Override
>     protected void onStop() {
>         wakeLock_.release();
>     }
>
>
> And this to your manifest:
>
> <uses-permission android:name="android.permission.WAKE_LOCK" />
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to