コード例 #1
0
 @Override
 public void clickPositiveButton(int dialogId) {
   switch (dialogId) {
     case DialogRes.DIALOG_ID_CANCEL_DOWNLOAD:
       if (taskMap.size() > 0) {
         for (Entry<Integer, DownloadAsyncTask1> en : taskMap.entrySet()) {
           if (!((DownloadAsyncTask1) en.getValue()).isCancelled()) {
             ((DownloadAsyncTask1) en.getValue()).cancel(true);
             ((DownloadAsyncTask1) en.getValue()).s_canDownload = false;
           }
         }
       }
       GBApplication.gbapp.quit();
       finish();
       break;
     case DialogRes.DIALOG_ID_NETWORK_NOT_AVALIABLE:
       if (Util.checkData(context)) {
         skipToNextPage();
       } else {
         GBApplication.gbapp.quit();
         finish();
       }
       break;
   }
   super.clickPositiveButton(dialogId);
 }
コード例 #2
0
 /** ¼ì²édb,Èç¹ûÊý¾ÝÕý³££¬Ìøתµ½ÏÂÒ»Ò³£¬Èç¹ûdbÒì³££¬³¢ÊÔ²éÕÒÊÇ·ñÓÐdb zip°ü²¢½âѹ */
 public void skipToNextPage() {
   if (Util.checkData(context)) {
     startNext();
   } else {
     unzipDbZip();
   }
 }
コード例 #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gba);
    MobclickAgent.onError(this);

    NotificationManager notificationManager =
        (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancel(Constant.alarmId);
    Intent intent = getIntent();

    boolean isNotification = intent.getBooleanExtra("isNotification", false);
    Logs.i("=== isNotification " + isNotification);

    String pType = intent.getStringExtra("nType");
    String pid = intent.getStringExtra("pId");
    String id = intent.getStringExtra("id");
    Logs.i("=== pType " + pType);
    if (isNotification) { // ͳ¼ÆÍÆËÍ
      Map<String, String> map = new HashMap<String, String>();
      map.put("pID", pid);
      map.put("platform", "android");
      map.put("deviceToken", Util.getDeviceId(context));
      MobclickAgent.onEvent(this, "PushEvent", map); // "SimpleButtonclick");
      uploadLoginLogNew("PushEvent", pid, "pID", null);
    }
    // unknow = 0,
    // 论文信息 = 1,
    // 问卷调查 = 2,
    // 医学新闻 = 3,
    // 用药安全 = 4,
    // 专题新闻 = 5
    if (isNotification) {
      PushConst.pushFlag = true;
      if (!TextUtils.isEmpty(pType) && pType.equals("3")) {
        PushConst.pushmodule = PushConst.News_MODULE;
      } else if (!TextUtils.isEmpty(pType) && pType.equals("1")) {
        PushConst.pushmodule = PushConst.RESEARCH_MODULE;
      } else if (!TextUtils.isEmpty(pType) && pType.equals("###")) {
        PushConst.pushmodule = PushConst.RESEARCH_MODULE;
      }
      PushConst.id = id;
    }
    inits();
    if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
      showDialog(DialogRes.DIALOG_ID_SDCARD_NOT_AVAILABLE);
    } else {
      if (checkUserInfo()) {
        skipToNextPage();
      } else {
        if (!checkUserInfo()) {
          Intent intent1 = new Intent(this, FirstStartForChooseActivity.class);
          startActivity(intent1);
        }
      }
    }
  }
コード例 #4
0
 /** * »ñÈ¡Ó¦ÓöÔÓ¦µÄdbÏÂÔصØÖ· */
 public void updateDBFile() {
   Properties propertyInfo = new Properties();
   propertyInfo.put(
       SoapRes.KEY_NEW_P_VERSION, Util.errorHandle2_0_2(Util.getCurrentVerName(this)));
   sendRequest(SoapRes.URLNewVersion, SoapRes.REQ_ID_NEW_VERSION, propertyInfo, baseHandler);
 }