本文整理汇总了Java中com.google.zxing.client.result.ParsedResultType类的典型用法代码示例。如果您正苦于以下问题:Java ParsedResultType类的具体用法?Java ParsedResultType怎么用?Java ParsedResultType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParsedResultType类属于com.google.zxing.client.result包,在下文中一共展示了ParsedResultType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQ_CAPTURE) {
if (resultCode == RESULT_OK) {
String result = data.getStringExtra(Intents.Scan.RESULT);
ParsedResultType type = ParsedResultType.values()[data.getIntExtra(
Intents.Scan.RESULT_TYPE, ParsedResultType.TEXT.ordinal())];
boolean isShow = false;
try {
if (type == ParsedResultType.URI) {
toBrowserActivity(result);
} else {
isShow = true;
}
} catch (ActivityNotFoundException e) {
isShow = true;
} finally {
lastResult = result;
if (isShow)
showDialog(DLG_SCAN_RESULT);
}
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
示例2: makeResultHandler
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
public static ResultHandler makeResultHandler(SweepActivity activity, Result rawResult) {
ParsedResult result = parseResult(rawResult);
if (result.getType() == ParsedResultType.URI) {
return new URIResultHandler(activity, result);
}
return new TextResultHandler(activity, result, rawResult);
}
示例3: makeResultHandler
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
public static ResultHandler makeResultHandler(Activity activity, Result rawResult) {
ParsedResult result = parseResult(rawResult);
ParsedResultType type = result.getType();
if (type.equals(ParsedResultType.ADDRESSBOOK)) {
return new AddressBookResultHandler(activity, result);
} else if (type.equals(ParsedResultType.EMAIL_ADDRESS)) {
return new EmailAddressResultHandler(activity, result);
} else if (type.equals(ParsedResultType.PRODUCT)) {
return new ProductResultHandler(activity, result, rawResult);
} else if (type.equals(ParsedResultType.URI)) {
return new URIResultHandler(activity, result);
} else if (type.equals(ParsedResultType.WIFI)) {
return new WifiResultHandler(activity, result);
} else if (type.equals(ParsedResultType.TEXT)) {
return new TextResultHandler(activity, result, rawResult);
} else if (type.equals(ParsedResultType.GEO)) {
return new GeoResultHandler(activity, result);
} else if (type.equals(ParsedResultType.TEL)) {
return new TelResultHandler(activity, result);
} else if (type.equals(ParsedResultType.SMS)) {
return new SMSResultHandler(activity, result);
} else if (type.equals(ParsedResultType.CALENDAR)) {
return new CalendarResultHandler(activity, result);
} else if (type.equals(ParsedResultType.ISBN)) {
return new ISBNResultHandler(activity, result, rawResult);
} else {
// The TextResultHandler is the fallthrough for unsupported formats.
return new TextResultHandler(activity, result, rawResult);
}
}
示例4: getType
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
public ParsedResultType getType() {
return mType;
}
示例5: updateCode
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
private void updateCode(final String codeHash, final String codeContents, final BarcodeFormat barcodeFormat,
final ParsedResultType barcodeType) {
// delay so we let the UI queries load first
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
CloudCallbackHandler<List<CloudEntity>> handler = new CloudCallbackHandler<List<CloudEntity>>() {
@Override
public void onComplete(List<CloudEntity> results) {
if (results.size() <= 0) {
// no record for this code exists - create a CloudEntity with the new code
CloudEntity newCode = new CloudEntity(QRCloudUtils.DATABASE_KIND_CODES);
newCode.put(QRCloudUtils.DATABASE_PROP_HASH, codeHash);
newCode.put(QRCloudUtils.DATABASE_PROP_CONTENTS, codeContents);
newCode.put(QRCloudUtils.DATABASE_PROP_FORMAT, barcodeFormat.name());
newCode.put(QRCloudUtils.DATABASE_PROP_TYPE, barcodeType.name());
newCode.put(QRCloudUtils.DATABASE_PROP_SCANS, 1); // this is the initial scan
newCode.put(QRCloudUtils.DATABASE_PROP_SOURCE, ContentProviderAuthority.DB_SOURCE);
// execute the insertion; nothing we can do on error, so ignore the result
getCloudBackend().insert(newCode, null);
} else {
CloudEntity existingEntity = results.get(0);
if (existingEntity != null) {
Object currentScanCount = existingEntity.get(QRCloudUtils.DATABASE_PROP_SCANS);
if (currentScanCount != null) {
// update to increase the scan count; nothing to do on error, so no result handler
existingEntity.put(QRCloudUtils.DATABASE_PROP_SCANS,
Integer.valueOf(currentScanCount.toString()) + 1);
getCloudBackend().update(existingEntity, null);
}
}
}
}
@Override
public void onError(IOException exception) {
// nothing else we can do
}
};
// now search for an existing record of this code
CloudQuery cloudQuery = new CloudQuery(QRCloudUtils.DATABASE_KIND_CODES);
cloudQuery.setFilter(F.eq(QRCloudUtils.DATABASE_PROP_HASH, codeHash));
cloudQuery.setLimit(1);
cloudQuery.setScope(Scope.PAST);
getCloudBackend().list(cloudQuery, handler);
}
}, NON_URGENT_QUERY_DELAY);
}
示例6: NDEFSmartPosterParsedResult
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
NDEFSmartPosterParsedResult(int action, String uri, String title) {
super(ParsedResultType.NDEF_SMART_POSTER);
this.action = action;
this.uri = uri;
this.title = title;
}
示例7: getType
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
/**
* A convenience method to get the parsed type. Should not be overridden.
*
* @return The parsed type, e.g. URI or ISBN
*/
public final ParsedResultType getType() {
return result.getType();
}
示例8: getType
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
/**
* A convenience method to get the parsed type. Should not be overridden.
*
* @return The parsed type, e.g. URI or ISBN
*/
public final ParsedResultType getType() {
return result.getType();
}
示例9: getType
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
/**
* A convenience method to get the parsed type. Should not be overridden.
*
* @return The parsed type, e.g. URI or ISBN
*/
public final ParsedResultType getType() {
return result.getType();
}
示例10: getType
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
/**
* A convenience method to get the parsed type. Should not be overridden.
*
* @return The parsed type, e.g. URI or ISBN
*/
public final ParsedResultType getType() {
return result.getType();
}
示例11: getType
import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
/**
* A convenience method to get the parsed type. Should not be overridden.
*
* @return The parsed type, e.g. URI or ISBN
*/
public final ParsedResultType getType() {
return result.getType();
}