나는 사용자가 android.I에서 전화를 잠금이 같은 방송 수신기를 사용하고 등록 할 때 화면이 꺼져 있는지 알아 싶지만 화면을 못하고 있어요 것은화면 잠금 및 잠금 해제
public class MyActivity extends Activity{
private static final String ACTION = "android.intent.action.ACTION_SCREEN_OFF";
BroadcastReceiver myReceiver;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
context = this;
final IntentFilter theFilter = new IntentFilter();
theFilter.addAction(ACTION);
context.registerReceiver(myReceiver, theFilter);
System.out.println("inside increate");
myReceiver = new BroadcastReceiver(){
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
System.out.println("phone locked*****");
}
};
}}
꺼져 여부
이 문제를 찾는 방법은 무엇입니까?
http://stackoverflow.com/questions/8968265/android-auto-logout-when-app-goes-to-background/8968763#8968763 –