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


Java PendingIntent.send方法代码示例

本文整理汇总了Java中android.app.PendingIntent.send方法的典型用法代码示例。如果您正苦于以下问题:Java PendingIntent.send方法的具体用法?Java PendingIntent.send怎么用?Java PendingIntent.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.PendingIntent的用法示例。


在下文中一共展示了PendingIntent.send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openNotify

import android.app.PendingIntent; //导入方法依赖的package包/类
/**
 * 打开通知栏消息
 */
private void openNotify(AccessibilityEvent event) {
    if (event.getParcelableData() == null || !(event.getParcelableData() instanceof Notification)) {
        return;
    }

    Notification notification = (Notification) event.getParcelableData();
    if (notification == null) {
        return;
    }
    PendingIntent pendingIntent = notification.contentIntent;
    try {
        pendingIntent.send();
        if (mHandler == null) {
            mHandler = new MHandler();
        }
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                clickMoneyAndKey();
            }
        }, 200);
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
开发者ID:duanyikang,项目名称:QiangYixia,代码行数:29,代码来源:HelpService.java

示例2: sendNotifacationReply

import android.app.PendingIntent; //导入方法依赖的package包/类
/**
 * 拉起微信界面
 * @param event
 */
private void sendNotifacationReply(AccessibilityEvent event) {
    hasAction = true;
    if (event.getParcelableData() != null
            && event.getParcelableData() instanceof Notification) {
        Notification notification = (Notification) event
                .getParcelableData();
        String content = notification.tickerText.toString();
        String[] cc = content.split(":");
        name = cc[0].trim();
        scontent = cc[1].trim();

        PendingIntent pendingIntent = notification.contentIntent;
        try {
            pendingIntent.send();
        } catch (PendingIntent.CanceledException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:xmlxin,项目名称:ReplyMessage,代码行数:24,代码来源:AutoReplyService.java

示例3: onReceive

import android.app.PendingIntent; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    switch (intent.getAction()) {
        case Installer.ACTION_INSTALL_STARTED:
            break;
        case Installer.ACTION_INSTALL_COMPLETE:
            localBroadcastManager.unregisterReceiver(this);

            showRelevantView(true);
            break;
        case Installer.ACTION_INSTALL_INTERRUPTED:
            localBroadcastManager.unregisterReceiver(this);
            // TODO: handle errors!
            break;
        case Installer.ACTION_INSTALL_USER_INTERACTION:
            PendingIntent installPendingIntent =
                    intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);

            try {
                installPendingIntent.send();
            } catch (PendingIntent.CanceledException e) {
                Log.e(TAG, "PI canceled", e);
            }

            break;
        default:
            throw new RuntimeException("intent action not handled!");
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:30,代码来源:SwapWorkflowActivity.java

示例4: openNotification

import android.app.PendingIntent; //导入方法依赖的package包/类
/**
 * 打开通知栏消息
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void openNotification(AccessibilityEvent event) {
    if (event.getParcelableData() == null || !(event.getParcelableData() instanceof Notification)) {
        return;
    }
    //以下是精华,将微信的通知栏消息打开
    Notification notification = (Notification) event.getParcelableData();
    PendingIntent pendingIntent = notification.contentIntent;
    try {
        pendingIntent.send();
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
开发者ID:mcxtzhang,项目名称:miser-utils,代码行数:18,代码来源:ComeOnMoneyService.java

示例5: launchAppForMessage

import android.app.PendingIntent; //导入方法依赖的package包/类
public void launchAppForMessage(Message message, AppLaunchMethod launchedFrom) {
    App app = getAppById(message.getAppId());

    PendingIntent pendingIntent = message.getPendingIntent();
    if (pendingIntent != null) {
        try {
            pendingIntent.send();
            return;
        } catch (CanceledException e) {
            Log.d(TAG, "Failed to launch pending intent because it was cancelled");
        }
    }
    Intent launchIntent = app.getLaunchIntentForMessage(message);
    if (launchIntent != null) {
        launchIntent.addFlags(268435456);
        safeStartActivity(launchIntent);
    }
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:19,代码来源:AppManager.java

示例6: openNotify

import android.app.PendingIntent; //导入方法依赖的package包/类
/** 打开通知栏消息*/
private void openNotify(AccessibilityEvent event) {
    if(event.getParcelableData() == null || !(event.getParcelableData() instanceof Notification)) {
        return;
    }
    Notification notification = (Notification) event.getParcelableData();
    PendingIntent pendingIntent = notification.contentIntent;
    try {
        pendingIntent.send();
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
开发者ID:qq1198,项目名称:mtoolbox,代码行数:14,代码来源:HongBaoService.java

示例7: openNotify

import android.app.PendingIntent; //导入方法依赖的package包/类
/** 打开通知栏消息 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void openNotify(AccessibilityEvent event)
{
	if (event.getParcelableData() == null || !(event.getParcelableData() instanceof Notification))
	{
		return;
	}
	// 将微信的通知栏消息打开
	Notification notification = (Notification) event.getParcelableData();
	PendingIntent pendingIntent = notification.contentIntent;
	try
	{
		pendingIntent.send();
	} catch (PendingIntent.CanceledException e)
	{
		e.printStackTrace();
	}
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:20,代码来源:MD5_jni.java

示例8: openNotify

import android.app.PendingIntent; //导入方法依赖的package包/类
/** 打开通知栏消息*/
   private void openNotify(AccessibilityEvent event)
   {
       if (event.getParcelableData() == null || !(event.getParcelableData() instanceof Notification))
{
           return;
       }
       Notification notification = (Notification) event.getParcelableData();
       PendingIntent pendingIntent = notification.contentIntent;
       try
{
           pendingIntent.send();
       }
catch (PendingIntent.CanceledException e)
{
           e.printStackTrace();
       }
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:19,代码来源:dex_smali.java

示例9: onHandleIntent

import android.app.PendingIntent; //导入方法依赖的package包/类
@Override
protected void onHandleIntent(@Nullable Intent intent) {
    Log.i(TAG, "onhandleIntent: ");
    final PendingIntent pi = intent.getParcelableExtra(Constants.PI_KEY);
    final Integer first = intent.getIntExtra(Constants.FIRST_KEY, 0);
    final Integer second = intent.getIntExtra(Constants.SECOND_KEY, 0);
    try {
        Integer result = first + second;
        TimeUnit.SECONDS.sleep(5);
        Intent resultIntent = new Intent().putExtra(Constants.RESULT_KEY, result);
        pi.send(CalcIntentService.this, Constants.SERVICE_RESULT, resultIntent);
    } catch (InterruptedException | PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
开发者ID:IstiN,项目名称:android-training-2017,代码行数:16,代码来源:CalcIntentService.java

示例10: startSessionActivity

import android.app.PendingIntent; //导入方法依赖的package包/类
private void startSessionActivity(MediaControllerCompat mediaController) {
    PendingIntent intent = mediaController.getSessionActivity();
    if (intent != null) {
        try {
            intent.send();
            return;
        } catch (PendingIntent.CanceledException e) {
            e.printStackTrace();
            Log.e(TAG, e.toString());
        }
    }
    Log.w(TAG, "Failed to open app by session activity.");
}
 
开发者ID:googlesamples,项目名称:android-media-controller,代码行数:14,代码来源:MediaAppControllerActivity.java

示例11: sendNotify

import android.app.PendingIntent; //导入方法依赖的package包/类
public static void sendNotify(AccessibilityEvent event) {
    List<CharSequence> texts = event.getText();
    if (!texts.isEmpty()) {
        String message = texts.get(0).toString();

        //过滤微信内部通知消息
        if (isInside(message)) {
            return;
        }

        //模拟打开通知栏消息
        if (event.getParcelableData() != null && event.getParcelableData() instanceof Notification) {
            Log.i("demo", "标题栏canReply=true");
            try {
                Notification notification = (Notification) event.getParcelableData();
                PendingIntent pendingIntent = notification.contentIntent;
                pendingIntent.send();
            } catch (PendingIntent.CanceledException e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:kaixuanluo,项目名称:pc-android-controller-android,代码行数:24,代码来源:WeChatMsg.java

示例12: onClickStartTestApk

import android.app.PendingIntent; //导入方法依赖的package包/类
public void onClickStartTestApk(View v) {
    Log.i("onClickStartTestApk", "Yay I was clicked.");
    mFullName.setText("Start Test Apk button pushed!");
    if (intents.containsKey("gov.nasa.arc.irg.test_guest_science_apk")) {
        PendingIntent start_apk_intent = intents.get("gov.nasa.arc.irg.test_guest_science_apk");
        try {
            start_apk_intent.send();
        } catch (PendingIntent.CanceledException e) {
            e.printStackTrace();
        }
    } else {
        Log.e("MainActivity", "Couldn't start test gs apk since we don't have a pending intent.");
    }
}
 
开发者ID:nasa,项目名称:astrobee_android,代码行数:15,代码来源:MainActivity.java

示例13: onConnectionFailed

import android.app.PendingIntent; //导入方法依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult result) {
    LOGD(TAG, "onConnectionFailed() reached, error code: " + result.getErrorCode()
            + ", reason: " + result.toString());
    disconnectDevice(mDestroyOnDisconnect, false /* clearPersistentConnectionData */,
            false /* setDefaultRoute */);
    mConnectionSuspended = false;
    if (mMediaRouter != null) {
        mMediaRouter.selectRoute(mMediaRouter.getDefaultRoute());
    }

    for (BaseCastConsumer consumer : mBaseCastConsumers) {
        consumer.onConnectionFailed(result);
    }

    PendingIntent pendingIntent = result.getResolution();
    if (pendingIntent != null) {
        try {
            pendingIntent.send();
        } catch (PendingIntent.CanceledException e) {
            LOGE(TAG, "Failed to show recovery from the recoverable error", e);
        }
    }
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:25,代码来源:BaseCastManager.java

示例14: sendNotifacationReply

import android.app.PendingIntent; //导入方法依赖的package包/类
/**
    *
    * @param event
    */
   private void sendNotifacationReply(AccessibilityEvent event)
   {
       hasAction = true;
       if (event.getParcelableData() != null
    && event.getParcelableData() instanceof Notification)
{
           Notification notification = (Notification) event
	.getParcelableData();
           String content = notification.tickerText.toString();
           String[] cc = content.split(":");
           name = cc[0].trim();
           scontent = cc[1].trim();

        //   android.util.Log.i("maptrix", "sender name =" + name);
      //     android.util.Log.i("maptrix", "sender content =" + scontent);


           PendingIntent pendingIntent = notification.contentIntent;
           try
    {
               pendingIntent.send();
           }
    catch (PendingIntent.CanceledException e)
    {
               e.printStackTrace();
           }
       }
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:33,代码来源:AppCompatDlalog.java

示例15: launchPendingIntent

import android.app.PendingIntent; //导入方法依赖的package包/类
public void launchPendingIntent(PendingIntent pendingIntent) {
    if (pendingIntent != null) {
        try {
            pendingIntent.send();
        } catch (CanceledException e) {
            Log.d(TAG, "Failed to launch pending intent because it was cancelled");
        }
    }
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:10,代码来源:AppManager.java


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