コード例 #1
0
  @Override
  protected void onPostExecute(Integer result) {
    try {
      connectDialog.dismiss();
    } catch (Exception e) {
    }

    if (result == CONNECTION_ERROR) {
      Toast toast =
          Toast.makeText(context, "Failed to save changes, connection failed", Toast.LENGTH_LONG);
      toast.show();
    } else if (result == FAIL) {
      Toast toast =
          Toast.makeText(context, "Camera rejected settings, please try again", Toast.LENGTH_LONG);
      toast.show();
    } else if (result == SUCCESS) {
      if (test) {
        context.beginTest();
      } else {
        Toast toast = Toast.makeText(context, "Settings updated successfully", Toast.LENGTH_SHORT);
        toast.show();
        context.saveComplete();
      }
    }
  }
コード例 #2
0
 @Override
 protected void onPreExecute() {
   connectDialog = new ConnectDialog();
   connectDialog.setCancelable(false);
   connectDialog.show(context.getFragmentManager(), "connect");
 }