show alert if no camera is available

This commit is contained in:
B. Petersen
2023-09-30 23:57:52 +02:00
committed by bjoern
parent b937ee443c
commit de0e0666fb
@@ -37,6 +37,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import com.b44t.messenger.DcContext;
import com.b44t.messenger.DcMsg;
@@ -554,6 +555,12 @@ public class AttachmentManager {
captureIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
captureIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
activity.startActivityForResult(captureIntent, requestCode);
} else {
new AlertDialog.Builder(activity)
.setCancelable(false)
.setMessage("Video recording not available")
.setPositiveButton(android.R.string.ok, null)
.show();
}
} catch (Exception e) {
Log.w(TAG, e);