當前位置: 首頁>>代碼示例>>Java>>正文


Java IntentIntegrator.REQUEST_CODE屬性代碼示例

本文整理匯總了Java中com.google.zxing.integration.android.IntentIntegrator.REQUEST_CODE屬性的典型用法代碼示例。如果您正苦於以下問題:Java IntentIntegrator.REQUEST_CODE屬性的具體用法?Java IntentIntegrator.REQUEST_CODE怎麽用?Java IntentIntegrator.REQUEST_CODE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.zxing.integration.android.IntentIntegrator的用法示例。


在下文中一共展示了IntentIntegrator.REQUEST_CODE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_OK) {

        if (requestCode == IntentIntegrator.REQUEST_CODE) {
            // 掃描二維碼回傳值
            IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
            String ewmString = result.getContents();

            Intent mintent = new Intent(MainActivity.this, QuickWebLoader.class);
            QuickBean bean = new QuickBean(ewmString);
            mintent.putExtra("bean", bean);
            startActivity(mintent);
        }
    }
}
 
開發者ID:quickhybrid,項目名稱:quickhybrid-android,代碼行數:16,代碼來源:MainActivity.java

示例2: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
	if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
		IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
		if (scanResult != null && scanResult.getFormatName() != null) {
			String data = scanResult.getContents();
			XmppUri uri = new XmppUri(data);
			if (xmppConnectionServiceBound) {
				verifyWithUri(uri);
				finish();
			} else {
				this.mPendingUri = uri;
			}
		} else {
			finish();
		}
	}
	super.onActivityResult(requestCode, requestCode, intent);
}
 
開發者ID:syntafin,項目名稱:TenguChat,代碼行數:19,代碼來源:VerifyOTRActivity.java

示例3: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
	if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
		IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
		if (scanResult != null && scanResult.getFormatName() != null) {
			String data = scanResult.getContents();
			Invite invite = new Invite(data);
			if (xmppConnectionServiceBound) {
				invite.invite();
			} else if (invite.getJid() != null) {
				this.mPendingInvite = invite;
			} else {
				this.mPendingInvite = null;
			}
		}
	}
	super.onActivityResult(requestCode, requestCode, intent);
}
 
開發者ID:xavierle,項目名稱:messengerxmpp,代碼行數:18,代碼來源:StartConversationActivity.java

示例4: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == IntentIntegrator.REQUEST_CODE) {
        /*
        ** If result code is OK, it means a QR CODE has been read
        ** So we have to parse the content and to add an Account into our list
        */
        if (resultCode == RESULT_OK) {
            OtpURL url = new OtpURL(data.getStringExtra("SCAN_RESULT"));
            if (!url.parse()) {
                Snackbar.make(findViewById(R.id.content_main), "QR Code invalide", Snackbar.LENGTH_LONG).show();
                return;
            }
            if (!Preferences.get(this).addItem(new ReplicatorItem(url.secret, url.issuer, url.account, url.digits)))
                Snackbar.make(findViewById(R.id.content_main), "La clé du compte a été mise à jour", Snackbar.LENGTH_LONG).show();
            else
                Snackbar.make(findViewById(R.id.content_main), "Compte ajouté", Snackbar.LENGTH_LONG).show();
            if (Preferences.get(this).getItems().size() > 0)
                txt_no_account.setVisibility(View.INVISIBLE);
            adapter.clear();
            adapter.addAll(Preferences.get(this).getItems());
            adapter.notifyDataSetChanged();
        }
    }
}
 
開發者ID:JeanBarriere,項目名稱:Replicator,代碼行數:26,代碼來源:MainActivity.java

示例5: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == IntentIntegrator.REQUEST_CODE
            && resultCode == RESULT_OK) {

        Bundle extras = data.getExtras();
        String commands = extras.getString(
                Intents.Scan.RESULT);
        JSONObject jsonCommands = null;
        try {
            jsonCommands = new JSONObject(commands);
            if (startOrEnd == 's') {
                this.startStation = jsonCommands.getInt("startStation");
                ((TextView) findViewById(R.id.commandOutTextView)).setText(commands);
            } else {
                this.endStation = jsonCommands.getInt("endStation");
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
 
開發者ID:mirioeggmann,項目名稱:appquest-pedometer,代碼行數:22,代碼來源:WalkActivity.java

示例6: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == Activity.RESULT_OK) {
        switch (requestCode) {
            case IntentIntegrator.REQUEST_CODE:
                onBarcodeResult(requestCode, resultCode, data);
                break;
            case REQUEST_CODE_EDIT_LOCATION:
                onEditLocationResult(data);
                break;
        }
        return;
    }

    super.onActivityResult(requestCode, resultCode, data);
}
 
開發者ID:Macadamian,項目名稱:smart-pantry,代碼行數:16,代碼來源:AbstractManipulationActivity.java

示例7: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == IntentIntegrator.REQUEST_CODE) {
        if (resultCode == RESULT_OK) {

            IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
            Toast.makeText(this, result.getContents(), Toast.LENGTH_SHORT).show();
            String[] parsedTuringData = result.getContents().split(":");
            new TestRequestTask().execute(parsedTuringData);

        } else if (resultCode == RESULT_CANCELED) {

            Toast.makeText(this, "QR Scanning cancelled", Toast.LENGTH_SHORT).show();

        }
    }
}
 
開發者ID:ArtificialBadger,項目名稱:MDX-Exam-Software-Android,代碼行數:18,代碼來源:TestSelectionActivity.java

示例8: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
        IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
        if (scanResult != null && scanResult.getFormatName() != null) {
            String data = scanResult.getContents();
            XmppUri uri = new XmppUri(data);
            if (xmppConnectionServiceBound) {
                verifyWithUri(uri);
                finish();
            } else {
                this.mPendingUri = uri;
            }
        } else {
            finish();
        }
    }
    super.onActivityResult(requestCode, requestCode, intent);
}
 
開發者ID:kriztan,項目名稱:Pix-Art-Messenger,代碼行數:19,代碼來源:VerifyOTRActivity.java

示例9: onActivityResult

/**
 * Handle Activity Results
 * @param requestCode requestCode
 * @param resultCode resultCode (RESULT_SETTINGS is defined at the top)
 * @param data data
 */
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	super.onActivityResult(requestCode, resultCode, data);
	switch (requestCode) {
		//Come back from Settings
		case RESULT_SETTINGS:
		{
			applyPreferenceChanges();
			break;
		}
		// Receive from QR
		case IntentIntegrator.REQUEST_CODE:
			IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
			if (scanResult != null) {
				String content = scanResult.getContents();
				if(content == null) Log.e(APP_ID, "Error! Received nothing from QR-Code!");
				else {
					Log.d(APP_ID, "Received " + content + " from QR-Code!");
					restoreStateFromCode(content);
				}
			}
	}
}
 
開發者ID:vanitasvitae,項目名稱:EnigmAndroid,代碼行數:28,代碼來源:MainActivity.java

示例10: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode != Activity.RESULT_OK) {
        return;
    }
    if (requestCode ==  IntentIntegrator.REQUEST_CODE) {
        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
        if(result != null) {
            if(result.getContents() == null) {
                Toast.makeText(this, "掃碼取消!", Toast.LENGTH_SHORT).show();
            } else {
                mInputTextTV.setText(result.getContents());
            }
        }
    }
}
 
開發者ID:pili-engineering,項目名稱:PLDroidMediaStreaming,代碼行數:16,代碼來源:MainActivity.java

示例11: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
	switch (requestCode & 0xFFFF) {
		case IntentIntegrator.REQUEST_CODE: {
			IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
			if (scanResult != null && scanResult.getFormatName() != null) {
				String data = scanResult.getContents();
				Log.d(TAG, "data: " + data);
				scan.setText(data);
			}
			break;
		}
		default: {
			super.onActivityResult(requestCode, resultCode, intent);
			break;
		}
	}
}
 
開發者ID:emdete,項目名稱:Simplicissimus,代碼行數:18,代碼來源:Sample.java

示例12: onActivityResult

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
	  if(IntentIntegrator.REQUEST_CODE == requestCode && resultCode == Activity.RESULT_OK) {
		  IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
		  if (scanResult != null && scanResult.getContents()!=null) {
			 // Use qrcode string : scanResult.getContents() 
			  ObjCacher.lastQRScanned = scanResult.getContents();
			  fillImageViewWithQRCode(qrCodeView, scanResult.getContents());
			  validateAllFactors();
		  } 
	  }
	  if(requestCode == CAMREQ_CODE && resultCode == Activity.RESULT_OK) {
			Bundle extras = intent.getExtras();
			Bitmap picture = (Bitmap) extras.get("data");
			ObjCacher.lastFaceBitmapAuth = picture;
			faceRecView.setImageBitmap(picture);
			validateAllFactors();
	  }
}
 
開發者ID:uberspot,項目名稱:Offline3fAuth,代碼行數:18,代碼來源:AuthFragment.java

示例13: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == IntentIntegrator.REQUEST_CODE) {
        if (resultCode == RESULT_OK) {
            final String contents = data.getStringExtra(Intents.Scan.RESULT);
            mInput.postDelayed(new Runnable() {
                @Override
                public void run() {
                    mInput.setText(contents);
                    if (getContext() != null) {
                        Toast.makeText(getContext(), R.string.decoded, Toast.LENGTH_SHORT).show();
                    }
                }
            }, 200);
        }

    } else if (requestCode == REQUEST_PICK_IMAGE) {
        if (resultCode == RESULT_OK) {
            if (mDecodeImageTask != null && !mDecodeImageTask.isCancelled()) {
                mDecodeImageTask.cancel(true);
            }
            mDecodeImageTask = new DecodeImageTask(getContext().getApplicationContext(), mInput);
            mDecodeImageTask.execute(data.getData());
        }

    }
}
 
開發者ID:tranleduy2000,項目名稱:text_converter,代碼行數:28,代碼來源:BarCodeCodecFragment.java

示例14: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == IntentIntegrator.REQUEST_CODE) {
        // QR scan results came back
        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
        EditTextPreference pref = (EditTextPreference) findPreference("public_key");
        if (pref.getOnPreferenceChangeListener().onPreferenceChange(pref, result.getContents()))
            pref.setText(result.getContents());
    }
    else
        ((CheckBoxPreference)findPreference(perms.keyAt(requestCode))).setChecked(resultCode == Activity.RESULT_OK);
    super.onActivityResult(requestCode, resultCode, data);
}
 
開發者ID:jplitza,項目名稱:DeviceAdministrator,代碼行數:13,代碼來源:SettingsActivity.java

示例15: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
        IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode,
                intent);

        if (scanResult != null && scanResult.getFormatName() != null) {
            String data = scanResult.getContents();
            handleUri(Uri.parse(data));
        }
    }

    finish();
    super.onActivityResult(requestCode, requestCode, intent);
}
 
開發者ID:kriztan,項目名稱:Pix-Art-Messenger,代碼行數:15,代碼來源:UriHandlerActivity.java


注:本文中的com.google.zxing.integration.android.IntentIntegrator.REQUEST_CODE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。