2011. 1. 6. 15:33
sms 송신 이벤트 발생 확인하기
2011. 1. 6. 15:33 in Program Study/Android
private ContentObserver observer = null; private final Uri inboxUri = Uri.parse("content://sms/"); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); test(); } private void test() { observer = new SMSObserver(new Handler); getContentResolver().registerContentObserver(inboxUri, Boolean.FALSE, observer); } class SMSObserver extends ContentObserver { public SMSObserver(Handler handler) { super(new Handler()); } @Override public void onChange(boolean selfChange) { Log.d("test_woori", "call onChange"); } } public void onDestroy(){ super.onDestroy(); getContentResolver().unregisterContentObserver(observer); }