Title basically says it all. The below code doesn't throw any errors, it just doesn't start the new activity. Code below.
I have tried modifying startActivity(new Intent(mCtx, NewActivity.class));
to read startActivity(new Intent(MyListActivity.this, NewActivity.class));
I have been testing this in Eclipse with an AVD.
Any thoughts on this would be appreciated - thanks!
public class MyListActivity extends ListActivity {
private Context mCtx;
MyContentObserver mContentObserver;
@Override
public void onCreate(Bundle onSavedInstance) {
super.onCreate(onSavedInstance);
setContentView(R.layout.calls_list);
mContentObserver = new MyContentObserver(this);
this.getApplicationContext().getContentResolver().registerContentObserver(CallLog.Calls.CONTENT_URI, true, mContentObserver);
}
private class MyContentObserver extends ContentObserver {
private Context mCtx;
public MyContentObserver(Context ctx ) {
super(null);
mCtx = ctx;
}
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
startActivity(new Intent(mCtx, NewActivity.class));
}
}
}