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://www.cnblogs.com/mfrbuaa/p/3759334.html