Beispiel #1
0
    protected void onPostExecute(String pjson) {

      if (activity == null) {

        Log.w("RotationAsync", "onPostExecute() skipped -- no activity");
      } else {
        activity.CreateList(pjson);
      }

      try {
        pDialog.dismiss();
        pDialog = null;
      } catch (Exception e) {

        Log.v("OnPOSTExecute", "ERROR");
        e.printStackTrace();
      }
    }
Beispiel #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.clinic_activity);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle("Clinic List");

    cd = new ConnectionDetector(getApplicationContext());

    if (!cd.isConnectingToInternet()) {

      alert.showAlertDialog(
          ListClinic.this,
          "Internet Connection Error",
          "Please connect to working Internet connection",
          false);

      return;
    }

    Intent in = getIntent();
    MIO_ID = in.getLongExtra("MIO_ID", 0);

    clinictList = new ArrayList<Map<String, String>>();

    task = (LoadClinic) getLastNonConfigurationInstance();
    if (task == null) {
      task = new LoadClinic(this);
      task.execute();

    } else {
      task.attach(this);
      CreateList(task.getJSON());
    }
    // get listview
    ListView lv = getListView();

    lv.setOnItemClickListener(
        new android.widget.AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> arg0, View view, int arg2, long arg3) {

            TextView clinic_id = ((TextView) view.findViewById(R.id.clinicid));

            TextView clinic_name = ((TextView) view.findViewById(R.id.clinicname));
            TextView clinic_address = ((TextView) view.findViewById(R.id.clinicaddress));
            TextView clinic_target = ((TextView) view.findViewById(R.id.clinic_target_value));
            TextView clinic_market = ((TextView) view.findViewById(R.id.clinicmarket));

            TextView clinic_contact = ((TextView) view.findViewById(R.id.cliniccntnumlbl));

            String vDetails = "Id \t\t\t\t\t: " + clinic_id.getText().toString() + "\n";
            vDetails += "Name \t\t\t: " + clinic_name.getText().toString() + "\n";
            vDetails += "Address \t:  " + clinic_address.getText().toString() + "\n";
            vDetails += "Target \t\t:  " + clinic_target.getText().toString() + "\n";
            vDetails += "Market \t\t: " + clinic_market.getText().toString() + "\n";

            vDetails += "Contact \t:  " + clinic_contact.getText().toString() + "\n";

            alert.showAlertDialog(ListClinic.this, "Clinic Profile", vDetails, true);
          }
        });
  }