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


Java AccessibilityEvent.getParcelableData方法代码示例

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


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

示例1: openNotify

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的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: openNotification

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的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

示例3: sendNotifacationReply

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的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

示例4: watchNotifications

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
private boolean watchNotifications(AccessibilityEvent event) {
    // Not a notification
    if (event.getEventType() != AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED)
        return false;

    // Not a hongbao
    String tip = event.getText().toString();
    if (!tip.contains(WECHAT_NOTIFICATION_TIP)) return true;

    Parcelable parcelable = event.getParcelableData();
    if (parcelable instanceof Notification) {
        Notification notification = (Notification) parcelable;
        try {
            /* 清除signature,避免进入会话后误判 */
            signature.cleanSignature();

            notification.contentIntent.send();
        } catch (PendingIntent.CanceledException e) {
            e.printStackTrace();
        }
    }
    return true;
}
 
开发者ID:KoreHuang,项目名称:WeChatLuckyMoney,代码行数:24,代码来源:HongbaoService.java

示例5: onAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public boolean onAccessibilityEvent(AccessibilityService service, AccessibilityEvent event) {
    if (event.getParcelableData() instanceof Notification) {
        Notification notification = (Notification) event.getParcelableData();
        Log.d(TAG, "onNotification: " + notification + "; " + event);
        onNotification(event, notification);
    } else {
        List<CharSequence> list = event.getText();
        Log.d(TAG, "onNotification: " + list + "; " + event);
        if (event.getPackageName().equals(mContext.getPackageName())) {
            return false;
        }
        if (list != null) {
            onNotification(event, new NotificationInfo(event.getPackageName(), list));
        }
    }
    return false;
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:19,代码来源:NotificationListener.java

示例6: openNotify

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的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.view.accessibility.AccessibilityEvent; //导入方法依赖的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.view.accessibility.AccessibilityEvent; //导入方法依赖的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: sendNotify

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的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

示例10: onAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public boolean onAccessibilityEvent(android.accessibilityservice.AccessibilityService service, AccessibilityEvent event) {
    if (event.getParcelableData() instanceof Notification) {
        android.app.Notification notification = (android.app.Notification) event.getParcelableData();
        Log.d(TAG, "onNotification: " + notification + "; " + event);
        onNotification(Notification.create(notification, event.getPackageName().toString()));
    } else {
        List<CharSequence> list = event.getText();
        Log.d(TAG, "onNotification: " + list + "; " + event);
        if (event.getPackageName().equals(mContext.getPackageName())) {
            return false;
        }
        if (list != null) {
            onToast(event, new Toast(event.getPackageName().toString(), list));
        }
    }

    return false;
}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:20,代码来源:AccessibilityNotificationObserver.java

示例11: monitorNotifications

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/**
 * notification监控
 */
private void monitorNotifications(AccessibilityEvent event) {
    if (event.getEventType() != AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) return;
    if (event.getText() == null ||
            (event.getText().toString() != null && !event.getText().toString().contains(SelfConst.WX_RED_NOTIFICATION_TEXT)))
        return;
    //模拟点击Notification
    if (event.getParcelableData() != null && event.getParcelableData() instanceof Notification) {
        Notification notification = (Notification) event.getParcelableData();
        try {
            notification.contentIntent.send();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:WanAndroid,项目名称:GetRedPackets,代码行数:19,代码来源:WXRedPluginService.java

示例12: openAppByNotification

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/**
 * 根据收到的[通知事件] 打开通知
 * @param event
 */
public void openAppByNotification(AccessibilityEvent event) {
    if (event.getParcelableData() != null  && event.getParcelableData() instanceof Notification) {
        Notification notification = (Notification) event.getParcelableData();
        // 获取通知的内容 ...
        String content = notification.tickerText.toString();
        try {
            PendingIntent pendingIntent = notification.contentIntent;
            pendingIntent.send();
        } catch (PendingIntent.CanceledException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:18,代码来源:AceHelper.java

示例13: sendNotifacationReply

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的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

示例14: notificationEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/** 处理通知栏事件 */
private void notificationEvent(AccessibilityEvent event) {
    // 小细节, 抢完红包干啥
    if(!isRunningForeground(context())){
        mAppState = APP_STATE_BACKGROUND;
    }else {
        mAppState = APP_STATE_FOREGROUND;
    }

    Parcelable data = event.getParcelableData();
    if (data == null || !(data instanceof Notification)) {
        return;
    }

    List<CharSequence> texts = event.getText();
    if (!texts.isEmpty()) {
        String text = String.valueOf(texts.get(0));
        LogUtils.printOut(TAG, text);
        int index = text.lastIndexOf(":");
        if(index != -1) {
            text = text.substring(index + 1);
        }
        if(text.contains(KEY)) {
            isReceived = true;
            Notification nf = (Notification) data;
            PendingIntent pendingIntent = nf.contentIntent;
            if(NotifyUtils.isLockScreen()) {  // 是否为锁屏或黑屏状态
                if(config().isLockScreenRob()){
                    NotifyUtils.wakeAndUnlock();
                    NotifyUtils.send(pendingIntent); // 打开微信
                }else{
                    NotifyUtils.showNotify(context(), String.valueOf(nf.tickerText), pendingIntent); // 显示有红包通知
                }
            } else {
                NotifyUtils.send(pendingIntent); // 打开微信
            }

            // 播放声音和震动
            NotifyUtils.playEffect(context(), config());
        }
    }
}
 
开发者ID:A-Miracle,项目名称:QiangHongBao,代码行数:43,代码来源:WeChatAccessibilityJob.java

示例15: notificationEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/** 通知栏状态变化 */
private void notificationEvent(AccessibilityEvent event) {
    // 小细节, 抢完红包干啥
    if(!isRunningForeground(context())){
        mAppState = APP_STATE_BACKGROUND;
    }else {
        mAppState = APP_STATE_FOREGROUND;
    }

    Parcelable data = event.getParcelableData();
    if (data == null || !(data instanceof Notification)) {
        return;
    }

    List<CharSequence> texts = event.getText();
    if (!texts.isEmpty()) {
        String text = String.valueOf(texts.get(0));
        LogUtils.printOut(TAG, text);
        int index = text.lastIndexOf(":");
        if(index != -1) {
            text = text.substring(index + 1);
        }
        if(text.contains(KEY)) {
            isReceived = true;
            Notification nf = (Notification) data;
            PendingIntent pendingIntent = nf.contentIntent;
            if(NotifyUtils.isLockScreen()) {  // 是否为锁屏或黑屏状态
                if(config().isLockScreenRob()){
                    NotifyUtils.wakeAndUnlock();
                    NotifyUtils.send(pendingIntent); // 打开QQ
                }else{
                    NotifyUtils.showNotify(context(), String.valueOf(nf.tickerText), pendingIntent); // 显示有红包通知
                }
            } else {
                NotifyUtils.send(pendingIntent); // 打开QQ
            }

            // 播放声音和震动
            NotifyUtils.playEffect(context(), config());
        }
    }
}
 
开发者ID:A-Miracle,项目名称:QiangHongBao,代码行数:43,代码来源:QQAccessibilityJob.java


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