Funcionalidad botones de cancelar

This commit is contained in:
mosterTeco 2024-05-11 17:11:06 -06:00
parent 7edc71a7ff
commit 4f693a95e0
4 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import adapters.DoctorDataBaseHelper
import adapters.PacienteAdapter
import data.Paciente
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
@ -38,6 +39,12 @@ class EliminarActivity : AppCompatActivity() {
Toast.makeText(this, "Por favor, selecciona un paciente para eliminar.", Toast.LENGTH_SHORT).show()
}
}
binding.btnCancelar.setOnClickListener {
val intent = Intent(this@EliminarActivity, PrincipalActivity::class.java)
startActivity(intent)
finish()
}
}
private fun cargarListaPacientes() {

View File

@ -2,6 +2,7 @@ package com.terratenientes.medicalhealth
import adapters.RecetaAdapter
import adapters.RecetaDataBaseHelper
import android.content.Intent
import data.Receta
import android.os.Bundle
import android.widget.Toast
@ -39,6 +40,13 @@ class EliminarRecetaActivity : AppCompatActivity() {
Toast.makeText(this, "Por favor, seleccione una receta para eliminar", Toast.LENGTH_SHORT).show()
}
}
binding.btnCancelarr.setOnClickListener {
val intent = Intent(this@EliminarRecetaActivity, PrincipalActivity::class.java)
startActivity(intent)
finish()
}
}
private fun cargarListaRecetas() {

View File

@ -40,6 +40,7 @@
android:text="@string/bt_eliminar" />
<Button
android:id="@+id/btn_cancelar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/bt_cancelar"

View File

@ -40,6 +40,7 @@
android:text="@string/bt_eliminar" />
<Button
android:id="@+id/btn_cancelarr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/bt_cancelar"