I want to know if there is any way to get the message displayed in the Toast in a different way.
I have created a QR code reader that works with zxing. When scanning the code, the result is sent to a toast. I want the message that results from the QR code to be displayed in another window and if it is a link that allows me to open it with the default browser of my mobile phone.
public class MainActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler{
private ZXingScannerView zXingScannerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void scan(View view){
zXingScannerView =new ZXingScannerView(getApplicationContext());
setContentView(zXingScannerView);
zXingScannerView.setResultHandler(this);
zXingScannerView.startCamera();
}
@Override
protected void onPause() {
super.onPause();
zXingScannerView.stopCamera();
}
@Override
public void handleResult(Result result) {
Toast.makeText(getApplicationContext(),result.getText(),Toast.LENGTH_LONG).show();
zXingScannerView.resumeCameraPreview(this);
}
}