Пример #1
0
  @Override
  public void showFavMergeDialogAction() {
    // TODO Auto-generated method stub
    int localFavCount = LoginInfo.getInstance().favJSONArray.length();
    String msg = String.format(context.getString(R.string.prompt_merge_fav_house), localFavCount);
    String status = "success";

    context.showYesNoDialog_TrackCollect_Login(
        "登入成功!",
        msg,
        status,
        new OkOnClickListener() {
          @Override
          public void didClickOk() {
            // TODO: yes, 要合併
            String houseNOs = LoginInfo.getInstance().getFavHouseNOs();
            if (!houseNOs.equals("")) {

              Log.e("test", "houseNOs:" + houseNOs);
              TrackService.trackHouse(
                  houseNOs,
                  "",
                  new TrackCallback() {
                    @Override
                    public void onResult(boolean success, String debugMessage) {
                      Log.e("test", "trackHouse:" + success + " msg:" + debugMessage);
                      // 不管trackhouse的merge有沒有成功,都繼續進行登入後更新資料動作
                      updateIsLoginAction();
                    }
                  });
            } else {
              updateIsLoginAction();
            }
          }

          @Override
          public void didClickCancel() {
            // TODO: no, 不合併
            showConfirmDialogAction();
          }
        });
  }
Пример #2
0
  @Override
  public void updateUserDataAction() {
    // TODO Auto-generated method stub
    String mobile = LoginInfo.getInstance().getMemberStringData(UserConstants.KEY_MOBILE);
    String email = LoginInfo.getInstance().getMemberStringData(UserConstants.KEY_EMAIL);

    if (mobile.equals("") && email.equals("")) {
      Intent intent = new Intent().setClass(context, InputBasicDataActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      context.startActivity(intent);
    }
  }
Пример #3
0
  @Override
  public void showConfirmDialogAction() {
    // TODO Auto-generated method stub
    String status = "confirm";
    context.showYesNoDialog_TrackCollect_Login(
        "",
        context.getString(R.string.prompt_delete_fav),
        status,
        new OkOnClickListener() {

          @Override
          public void didClickOk() {
            // 確定要刪除local favs,略過合併功能
            updateIsLoginAction();
          }

          @Override
          public void didClickCancel() {
            // 不直接刪除,退回上一步驟,詢問是否合併
            showFavMergeDialogAction();
          }
        });
  }
Пример #4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_news_detail);

    setToolbarView(getString(R.string.house_news));

    // Get Extra
    Bundle extra = getIntent().getExtras();
    newsIdArray = extra.getStringArrayList(BHConstants.EXTRA_NEWSID_ARRAY);
    currentNewsPosition = extra.getInt(BHConstants.EXTRA_NEWS_POSITION);

    setViews();

    // reloadViews();

    setListener();

    getSingleNews(newsIdArray.get(currentNewsPosition));
  }
Пример #5
0
 @Override
 protected void onResume() {
   super.onResume();
 }