我设法实现了 robospice 示例(GoogleHttpClientSpiceService)并且它可以工作 - 它成功地进入服务器,获取数据并将其存储在缓存中。如果 Activity 不是 onPause,甚至会显示 toast 并更新 GUI。
我的问题(也是我尝试 robospice 的唯一原因)是,如果 Activity 恢复,它不会再次收到通知。难道我做错了什么?
@Override //THIS IS NOT CALLED ON ACTIVITY RESUME (BECAUSE OF THIS I CANNOT DISMISS DIALOG)
public void onRequestSuccess( final String result ) {
Toast.makeText( PrijavaActivity.this, "success", Toast.LENGTH_SHORT ).show();
Log.w(TAG, "sakses" + result);
FragmentManager fm = getSupportFragmentManager();
Fragment fragment = fm.findFragmentByTag("prijavaDialog");
if(fragment!=null) {
FragmentTransaction ft = fm.beginTransaction();
ft.remove(fragment);
ft.commit();
}
}
谢谢...