Exemple #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);
  }
Exemple #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);
  }
Exemple #3
0
 private void deleteVet() {
   SaveSharedPreference.removeKeyValuePair(context, PREF_VET_NUMBER); // UserData.getVetNumber()
   SaveSharedPreference.removeKeyValuePair(context, PREF_VET_NAME); // UserData.getVetNumber()
   vetNumber = "";
   vetName = "";
 }
Exemple #4
0
 private void getVet() {
   vetNumber =
       SaveSharedPreference.getKeyValuePair(context, PREF_VET_NUMBER); // UserData.getVetNumber()
   vetName = SaveSharedPreference.getKeyValuePair(context, PREF_VET_NAME);
 }