我正在尝试使用xzing import扫描QR码并在对话框中显示2个按钮的QR详细信息。第一个按钮应该能够拨打固定号码(紧急号码),第二个按钮应该能够通过whatsapp分享QR详细信息以及我当前的位置。
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
get the extras that are returned from the intent
String contents = intent.getStringExtra("SCAN_RESULT");
String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
>I want to show the string value in the dialogbox with 2 buttons.
showDialog(this);
}
}
}
private void showDialog(AndroidQrCodeExample androidQrCodeExample) {
AlertDialog.Builder builder = new AlertDialog.Builder(this)
>I dont know whether I can use this command setmessage to display as I am new in android.Please explain me How to do it.
.setMessage(contents)
.setTitle("Response")
.setPositiveButton("OK",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int which) {
dialog.dismiss();
}
});
builder.show();
}
}strong text