java - Intent.createChooser android QR code reader -


i want user choose qr reader installed apps. done using intent.createchooser. when picture taken qr reader, qr code should sent application. ive tried far:

        intent intent = new intent(intent.action_send);             intent.settype("text/plain");             intent.addflags(intent.flag_activity_clear_when_task_reset);             intent.putextra("scan_mode", "qr_code_mode");              string title = (string) getresources().gettext(r.string.chooser_title);              intent chooser = intent.createchooser(intent, title);              startactivityforresult(chooser, custom_request_qr_scanner); 

the scanner doens't start correctly, shows sample qr code. have feeling intent.settype("text/plain") might wrong? type qr reader? or how start qr reader way correctly?

i have activityresult when qr app done:

@override public void onactivityresult(int requestcode, int resultcode, intent intent) {     if (requestcode == custom_request_qr_scanner) {          log.d(tag, "qr activity complete");                         //successful scan                         if (resultcode == result_ok) { 

replace

intent.settype("text/plain"); 

with

intent.settype("com.google.zxing.client.android.scan"); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -