当前位置: 首页>>代码示例>>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;未经允许,请勿转载。