So im trying to implement a barcode scanner functionallity And i have this piece of code
private void showMessageOKCancel(String message, DialogInterface.OnClickListener okListener) {
new android.support.v7.app.AlertDialog.Builder(addquantityactivity.this)
.setMessage(message)
.setPositiveButton("OK", okListener)
.setNegativeButton("Cancel", null)
.create()
.show();
}
and i get this error error: package android.support.v7.app.AlertDialog does not exist new android.support.v7.app.AlertDialog.Builder(addquantityactivity.this)
To mention, i use androidx and i have tried the following imports..Also other solutions on stackoverflow didnt helped me.
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;