또한에 화면을 유지하는 방법 "(참) setKeepScreenOn"를 사용할 수 있습니다, 한 OnCreate에서
private RelativeLayout rLayout;
() 원하는 레이아웃을 얻을 : 당신이 말할 수있는 (루트) RelativeLayout의가있는 애니메이션은 장소 소요
final WatchViewStub stub = (WatchViewStub)
findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new
WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
// rLayout가 다시 애니메이션 그럼 당신은 (false)를 setKeepScreenOn에 애니메이션 상 AnimationListener을 설정할 수 있습니다
rLayout = (RelativeLayout) stub.
findViewById(R.id.your_layout);
relativeLayout.setKeepScreenOn(true);
일어난다있는 루트 레이아웃입니다 :
yourAnimation.setAnimationListener(new
Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if(animation.hasEnded())
rLayout.setKeepScreenOn(false);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
감사를 이 방법으로 작업했지만 단 한 가지 우려가 있습니다. PowerManager.SCREEN_BRIGHT_WAKE_LOCK이 사용되지 않으며 다른 대안이 있습니까? – sam
나는 현재 어떤 것도 모르고있다. – gruszczy