mObserver = new ContentObserver(new Handler()) {
public void onChange(boolean selfChange) {
updateScreenRotationBtn();
}
};
2.注册ContentResolver cr = getContentResolver(); Uri tmp = Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION); cr.registerContentObserver(tmp, false, mObserver);
android点滴之ContentObserver的使用,布布扣,bubuko.com
原文地址:http://blog.csdn.net/lskshz/article/details/25686827