当前位置: 首页>>代码示例>>Java>>正文


Java ParsedResultType类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:joinAero,项目名称:AndroidWebServ,代码行数:27,代码来源:WSActivity.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:ResultHandlerFactory.java

示例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);
  }
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:31,代码来源:ResultHandlerFactory.java

示例4: getType

import com.google.zxing.client.result.ParsedResultType; //导入依赖的package包/类
public ParsedResultType getType() {
    return mType;
}
 
开发者ID:yaji,项目名称:camera-through-wallpaper,代码行数:4,代码来源:QRRecognizer.java

示例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);
}
 
开发者ID:EnteriseToolkit,项目名称:codetalk,代码行数:52,代码来源:MessageViewerActivity.java

示例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;
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:7,代码来源:NDEFSmartPosterParsedResult.java

示例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();
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:9,代码来源:ResultHandler.java

示例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();
}
 
开发者ID:xiong-it,项目名称:ZXingAndroidExt,代码行数:9,代码来源:ResultHandler.java

示例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();
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:9,代码来源:ResultHandler.java

示例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();
}
 
开发者ID:WallaceLiu,项目名称:oschina-android-app,代码行数:9,代码来源:ResultHandler.java

示例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();
}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:9,代码来源:ResultHandler.java


注:本文中的com.google.zxing.client.result.ParsedResultType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。