本文整理汇总了Java中org.andengine.util.ActivityUtils.keepScreenOn方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityUtils.keepScreenOn方法的具体用法?Java ActivityUtils.keepScreenOn怎么用?Java ActivityUtils.keepScreenOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.util.ActivityUtils
的用法示例。
在下文中一共展示了ActivityUtils.keepScreenOn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.andengine.util.ActivityUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_frame_container);
ButterKnife.bind(this);
ActivityUtils.keepScreenOn(this);
String fragment;
Bundle extras = getIntent().getExtras();
if (extras != null) {
fragment = extras.getString(IntentKeys.FRAGMENT);
} else {
fragment = Fragments.GAME_FLOW_SELECT_LEVEL;
}
navigateTo(fragment);
_justCreated = true;
}
示例2: acquireWakeLock
import org.andengine.util.ActivityUtils; //导入方法依赖的package包/类
private void acquireWakeLock(final WakeLockOptions pWakeLockOptions) {
if (pWakeLockOptions == WakeLockOptions.SCREEN_ON) {
ActivityUtils.keepScreenOn(this);
} else {
final PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
this.mWakeLock = pm.newWakeLock(pWakeLockOptions.getFlag() | PowerManager.ON_AFTER_RELEASE, Constants.DEBUGTAG);
try {
this.mWakeLock.acquire();
} catch (final SecurityException pSecurityException) {
Debug.e("You have to add\n\t<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>\nto your AndroidManifest.xml !", pSecurityException);
}
}
}
示例3: acquireWakeLock
import org.andengine.util.ActivityUtils; //导入方法依赖的package包/类
private void acquireWakeLock(final WakeLockOptions pWakeLockOptions) {
if(pWakeLockOptions == WakeLockOptions.SCREEN_ON) {
ActivityUtils.keepScreenOn(this);
} else {
final PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
this.mWakeLock = pm.newWakeLock(pWakeLockOptions.getFlag() | PowerManager.ON_AFTER_RELEASE, Constants.DEBUGTAG);
try {
this.mWakeLock.acquire();
} catch (final SecurityException pSecurityException) {
Debug.e("You have to add\n\t<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>\nto your AndroidManifest.xml !", pSecurityException);
}
}
}
示例4: onCreate
import org.andengine.util.ActivityUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_frame_container);
ButterKnife.bind(this);
ActivityUtils.keepScreenOn(this);
_gameClient = GoogleFlipGameApplication.getGameClient();
_multiplayerMode = MultiplayerMode.values()[Prefs.getInt(PrefKeys.MULTIPLAYER_MODE, 0)];
if (_multiplayerMode.equals(MultiplayerMode.CLIENT)) {
_clientService = GoogleFlipGameApplication.getBluetoothClientService();
_clientDeviceChangedListener = new DeviceChangeListenerAdapter() {
@Override
public void onDeviceRemoved(String deviceName, String address) {
handleConnectionLost();
}
};
}
_gameClientListener = new GameClientListenerAdapter() {
@Override
public void onClientsChanged(List<ClientVO> clients) {
checkConnectionLost();
}
};
String fragment;
Bundle extras = getIntent().getExtras();
if (extras != null) {
fragment = extras.getString(IntentKeys.FRAGMENT);
} else {
fragment = Fragments.GAME_FLOW_SCOREBOARD;
}
navigateTo(fragment);
}