コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    trAddButtons = (TableRow) findViewById(R.id.tableRowAddButtons);
    btnAddSave = (Button) findViewById(R.id.btnAddSave);

    trAddButtons.setVisibility(View.VISIBLE);
    tvTitleBar.setText(R.string.add_contact);
    btnAddSave.setOnClickListener(this);
  }
コード例 #2
0
  @Override
  protected void onPostExecute(final JSONObject result) {

    if (progressBar != null) {
      progressBar.setVisibility(4);
    }

    if (result == null && error.length() > 0) {
      // An error occurred.
      Toast.makeText(activity.getApplicationContext(), error, Toast.LENGTH_SHORT).show();
    } else {
      super.onPostExecute(result);
      if (activity instanceof ContactActivity) {
        ((ContactActivity) activity).setDataAndRestart(result);
      } else if (activity instanceof SearchActivity) {
        ((SearchActivity) activity).displayContactList(result);
      }
    }
  }