本文整理汇总了Java中org.bitcoinj.uri.BitcoinURIParseException类的典型用法代码示例。如果您正苦于以下问题:Java BitcoinURIParseException类的具体用法?Java BitcoinURIParseException怎么用?Java BitcoinURIParseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BitcoinURIParseException类属于org.bitcoinj.uri包,在下文中一共展示了BitcoinURIParseException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import org.bitcoinj.uri.BitcoinURIParseException; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Constants.QR_ACTIVITY_RESULT_REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
final String scanContent = data.getStringExtra(Intents.Scan.RESULT);
try {
BitcoinURI bitcoinURI = new BitcoinURI(scanContent);
if (bitcoinURI.getAddress() != null) {
addressEditText.setText(bitcoinURI.getAddress().toString());
return;
}
} catch (BitcoinURIParseException e) {
Log.w(TAG, "Could not parse scanned content: '" + scanContent + "'", e);
}
// set to scanned content if no address detected
addressEditText.setText(scanContent);
}
}
}
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:21,代码来源:SendDialogFragment.java
示例2: handlePaymentRequestReceive
import org.bitcoinj.uri.BitcoinURIParseException; //导入依赖的package包/类
private void handlePaymentRequestReceive(byte[] requestPayload, boolean resume) throws PaymentException, BitcoinURIParseException {
if(!resume) {
NetworkParameters params = walletServiceBinder.getNetworkParameters();
PaymentRequestReceiveStep request = new PaymentRequestReceiveStep(params);
DERObject input = DERParser.parseDER(requestPayload);
request.process(input);
bitcoinURI = request.getBitcoinURI();
}
boolean isPaymentAutoAccepted = SharedPrefUtils.isPaymentAutoAcceptEnabled(NFCClientServiceCLTV.this) && SharedPrefUtils.getPaymentAutoAcceptValue(NFCClientServiceCLTV.this).isGreaterThan(bitcoinURI.getAmount());
boolean isPaymentApproved = bitcoinURI.getAddress().toString().equals(approveAddress) && bitcoinURI.getAmount().toString().equals(approveAmount);
if(isPaymentAutoAccepted || isPaymentApproved) {
Log.d(TAG, "payment approved - isAutoAccepted: " + isPaymentAutoAccepted + ", isApproved: " + isPaymentApproved);
PaymentResponseSendCompactStep response = new PaymentResponseSendCompactStep(bitcoinURI, walletServiceBinder);
DERObject result = response.process(DERObject.NULLOBJECT);
derResponsePayload = result.serializeToDER();
transaction = response.getTransaction();
clientTxSignatures = response.getClientTransactionSignatures();
} else {
Log.d(TAG, "Not yet approved");
approveAddress = null;
approveAmount = null;
Intent intent = new Intent(Constants.PAYMENT_REQUEST);
intent.putExtra(Constants.PAYMENT_REQUEST_ADDRESS, bitcoinURI.getAddress().toString());
intent.putExtra(Constants.PAYMENT_REQUEST_AMOUNT, bitcoinURI.getAmount().toString());
LocalBroadcastManager
.getInstance(NFCClientServiceCLTV.this)
.sendBroadcast(intent);
}
}
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:32,代码来源:NFCClientServiceCLTV.java
示例3: getDialogFragment
import org.bitcoinj.uri.BitcoinURIParseException; //导入依赖的package包/类
@Override
protected DialogFragment getDialogFragment() {
try {
return ReceiveDialogFragment.newInstance(new BitcoinURI(BitcoinURI.convertToBitcoinURI(walletServiceBinder.getCurrentReceiveAddress(),this.coin(),"","")));
} catch (BitcoinURIParseException e) {
return null;
}
}
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:9,代码来源:ReceivePaymentFragment.java
示例4: onReceive
import org.bitcoinj.uri.BitcoinURIParseException; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
String uri = intent.getStringExtra(Constants.BITCOIN_URI_KEY);
try {
final BitcoinURI bitcoinURI = new BitcoinURI(uri);
startServers(bitcoinURI);
showAuthViewAndGetResult(bitcoinURI, false, false);
} catch (BitcoinURIParseException e) {
Log.w(TAG, "Could not parse Bitcoin URI: " + uri);
}
}
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:12,代码来源:MainActivity.java
示例5: onCreate
import org.bitcoinj.uri.BitcoinURIParseException; //导入依赖的package包/类
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
bitcoinURI = new BitcoinURI(getArguments().getString(BITCOIN_URI_KEY));
} catch (BitcoinURIParseException e) {
Log.e(TAG, "Could not parse Bitcoin URI: ", e);
}
}
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:10,代码来源:QrDialogFragment.java
示例6: onItemClick
import org.bitcoinj.uri.BitcoinURIParseException; //导入依赖的package包/类
@Override
public void onItemClick(TimeLockedAddress item, int position) {
try {
Address address = item.getAddress(params);
String uri = BitcoinURI.convertToBitcoinURI(address, null, null, null);
BitcoinURI addressUri = new BitcoinURI(uri);
QrDialogFragment
.newInstance(addressUri)
.show(getFragmentManager(), "address_qr_fragment");
} catch (BitcoinURIParseException e) {
Log.w(TAG, "Could not create bitcoin uri: ", e);
}
}
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:14,代码来源:WalletAddressList.java
注:本文中的org.bitcoinj.uri.BitcoinURIParseException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论