Issue
Problem :
I am testing android application using robotium, My Problem is screen gets off after few second if user did not interact with the app,how to keep screen always on for testing app?
What I tried :
- Made Stay awake on under development options of avd
I cross verified this post but it was related to development side where i cant modify the source of apk
My Question :
how to keep screen always on for avd testing app ?
Solution
For testing you can instantiate a WakeLock.
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = pm.newWakeLock(pm.SCREEN_DIM_WAKE_LOCK, "My wakelook");
wakeLock.acquire();
Don't forget the permisson WakeLock
<uses-permission android:name="android.permission.WAKE_LOCK" />
Alternatively you can try the "wake lock" option in the devices development settings.
Answered By - Namenlos
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.