private void updateUI() {
   if (mModelInfo != null) {
     byte[] htmlContent = Base64.decode(mModelInfo.content, Base64.DEFAULT);
     Logger.i(TAG, "ContractContent = " + new String(htmlContent));
     mWebView.loadDataWithBaseURL(null, new String(htmlContent), "text/html", "UTF-8", null);
   }
 }
  private void initData() {
    addrId = getIntent().getStringExtra(GlobalAction.ProfileAction.EXTRA_KEY_ADDR_ID);
    Logger.e(TAG, "AddrId = " + addrId);

    updateDataStatus(DataStatus.LOADING);
    mContractLogic.getContractAddrInfo(addrId);
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   Logger.e(TAG, "onCreate");
   if (savedInstanceState != null) {
     mModelInfo =
         (ContractModelInfo)
             savedInstanceState.getSerializable(
                 GlobalAction.ContractAction.EXTRA_KEY_CONTRACT_INFO);
   }
 }
 @Override
 protected void handleStateMessage(Message message) {
   super.handleStateMessage(message);
   Logger.d(TAG, "handleStateMessage: what = " + message.what);
   RespInfo respInfo = getRespInfo(message);
   switch (message.what) {
     case ProfileMessageType.MSG_GET_CONTRACT_ADDR_INFO_SUCCESS:
       onGetAddrInfoSuccess(respInfo);
       break;
     case ProfileMessageType.MSG_GET_CONTRACT_ADDR_INFO_FAILED:
       onGetAddrInfoFailed(respInfo);
       break;
   }
 }
Exemple #5
0
    private static boolean forceDeleteFile(File file) {
      boolean result = false;
      int tryCount = 0;
      while ((!result) && (tryCount++ < 10)) {
        result = file.delete();
        if (result) continue;
        try {
          synchronized (file) {
            file.wait(200L);
          }
        } catch (InterruptedException e) {
          Logger.e("Logger", "forceDeleteFile:", e);
        }
      }

      return result;
    }