本文整理汇总了C#中Android.Content.Intent.GetLongExtra方法的典型用法代码示例。如果您正苦于以下问题:C# Intent.GetLongExtra方法的具体用法?C# Intent.GetLongExtra怎么用?C# Intent.GetLongExtra使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Content.Intent
的用法示例。
在下文中一共展示了Intent.GetLongExtra方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnReceive
public override void OnReceive(Context context, Intent intent)
{
var action = intent.Action;
if (DownloadManager.ActionDownloadComplete.Equals(action)) {
var downloadId = intent.GetLongExtra(DownloadManager.ExtraDownloadId, 0);
var query = new DownloadManager.Query();
query.SetFilterById(_webViewClient.Enqueue);
var c = _webViewClient.Dm.InvokeQuery(query);
if (c.MoveToFirst()) {
var columnIndex = c.GetColumnIndex(DownloadManager.ColumnStatus);
if ((int) Android.App.DownloadStatus.Successful == c.GetInt(columnIndex)) {
var view = (ImageView) _webViewClient.Controls.Activity.FindViewById(12);
var uriString = c.GetString(c.GetColumnIndex(DownloadManager.ColumnLocalUri));
view.SetImageURI(Android.Net.Uri.Parse(uriString));
}
var list = new List<string>();
var columnNames = c.GetColumnNames();
for (var i = 0; i < c.ColumnCount; i++) {
list.Add(columnNames[i]);
}
columnIndex = c.GetColumnIndex(DownloadManager.ColumnReason);
var s = c.GetString(columnIndex);
_webViewClient.Controls.Title.Text = s;
}
}
}
示例2: OnReceive
/// <summary>
/// This is the entry point for all asynchronous messages sent from Android Market to
/// the application. This method forwards the messages on to the
/// <seealso cref="BillingService"/>, which handles the communication back to Android Market.
/// The <seealso cref="BillingService"/> also reports state changes back to the application through
/// the <seealso cref="ResponseHandler"/>.
/// </summary>
public override void OnReceive(Context context, Intent intent)
{
string action = intent.Action;
if (Consts.ACTION_PURCHASE_STATE_CHANGED.Equals(action))
{
string signedData = intent.GetStringExtra(Consts.INAPP_SIGNED_DATA);
string signature = intent.GetStringExtra(Consts.INAPP_SIGNATURE);
purchaseStateChanged(context, signedData, signature);
}
else if (Consts.ACTION_NOTIFY.Equals(action))
{
string notifyId = intent.GetStringExtra(Consts.NOTIFICATION_ID);
if (Consts.DEBUG)
{
Log.Info(TAG, "notifyId: " + notifyId);
}
notify(context, notifyId);
}
else if (Consts.ACTION_RESPONSE_CODE.Equals(action))
{
long requestId = intent.GetLongExtra(Consts.INAPP_REQUEST_ID, -1);
int responseCodeIndex = intent.GetIntExtra(Consts.INAPP_RESPONSE_CODE, (int)Consts.ResponseCode.RESULT_ERROR);
checkResponseCode(context, requestId, responseCodeIndex);
}
else
{
Log.Warn(TAG, "unexpected action: " + action);
}
}
示例3: handleCommand
/**
* The {@link BillingReceiver} sends messages to this service using intents.
* Each intent has an action and some extra arguments specific to that action.
* @param intent the intent containing one of the supported actions
* @param startId an identifier for the invocation instance of this service
*/
public void handleCommand(Intent intent, int startId)
{
string action = intent.Action;
if (Consts.DEBUG)
Log.Info(TAG, "handleCommand() action: " + action);
if (Consts.ACTION_CONFIRM_NOTIFICATION.Equals(action))
{
string[] notifyIds = intent.GetStringArrayExtra(Consts.NOTIFICATION_ID);
Execute(new ConfirmNotifications(startId, notifyIds));
}
else if (Consts.ACTION_GET_PURCHASE_INFORMATION.Equals(action))
{
string notifyId = intent.GetStringExtra(Consts.NOTIFICATION_ID);
Execute(new GetPurchaseInformation(startId, new string[] { notifyId }));
}
else if (Consts.ACTION_PURCHASE_STATE_CHANGED.Equals(action))
{
string signedData = intent.GetStringExtra(Consts.INAPP_SIGNED_DATA);
string signature = intent.GetStringExtra(Consts.INAPP_SIGNATURE);
purchaseStateChanged(startId, signedData, signature);
}
else if (Consts.ACTION_RESPONSE_CODE.Equals(action))
{
long requestId = intent.GetLongExtra(Consts.INAPP_REQUEST_ID, -1);
int responseCodeIndex = intent.GetIntExtra(Consts.INAPP_RESPONSE_CODE, (int)Consts.ResponseCode.RESULT_ERROR);
Consts.ResponseCode responseCode = (Consts.ResponseCode)responseCodeIndex;
checkResponseCode(requestId, responseCode);
}
}
示例4: restoreTransactions
private void restoreTransactions(Intent intent, int startId)
{
string packageName = PackageName;
long nonce = intent.GetLongExtra(EXTRA_NONCE, 0);
RestoreTransactions request = new RestoreTransactions(packageName, startId);
request.setNonce(nonce);
runRequestOrQueue(request);
}
示例5: getPurchaseInformation
private void getPurchaseInformation(Intent intent, int startId)
{
string packageName = PackageName;
long nonce = intent.GetLongExtra(EXTRA_NONCE, 0);
string[] notifyIds = intent.GetStringArrayExtra(EXTRA_NOTIFY_IDS);
GetPurchaseInformation request = new GetPurchaseInformation(packageName, startId, notifyIds);
request.setNonce(nonce);
runRequestOrQueue(request);
}