Exemplo n.º 1
0
  private void saveVet(String number, String name) {
    SaveSharedPreference.setKeyValuePair(context, PREF_VET_NUMBER, number);
    SaveSharedPreference.setKeyValuePair(context, PREF_VET_NAME, name);
    vetNumber = number;
    vetName = name;

    // UserData.setVetNumber(number);
    Helper.makeText(context, name + ": " + number + " saved.", Toast.LENGTH_LONG);
  }
Exemplo n.º 2
0
  private void callVet() {
    if (vetNumber == null || vetNumber.isEmpty()) {
      Helper.makeText(context, "Please pick a vet's number first.");
      return;
    }

    Date timeOfCall = new Date();
    SaveSharedPreference.setKeyValuePair(context, PREF_VET_LAST_CALL, timeOfCall.toString());

    Helper.makeText(context, "Calling...");

    Intent intent = new Intent(Intent.ACTION_CALL);
    intent.setData(Uri.parse("tel:" + vetNumber));
    startActivity(intent);
  }