/** 请求同步数据范例 */ private void requestSynData() { // TODO Auto-generated method stub try { List<ExampleBean> list = mModel.getSynTestData(); if (list.size() == 0) { mView.onDefault(null); } else { List<String> result = getStringListByExampleBeanList(list); mView.onSetSynTestData(result); } } catch (Exception e) { // TODO: handle exception mView.onError(null); } }
@SuppressWarnings("unchecked") @Override protected void onHandleViewMessage(Message msg) { // TODO Auto-generated method stub switch (msg.what) { case IExampleView.MESSAGE_ASYN_TESTDATA: List<String> list = (List<String>) msg.obj; mView.onSetAsynTestData(list); break; case IExampleView.MESSAGE_WAIT_BEGIN: mView.onWait(msg); default: break; } }
/** 打开新的Activity */ public void doStartActivity() { Intent intent = new Intent(); // 这里把应该封装的intent封装进来 mView.onStartActivity(intent); }