PDevice.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:phonk 作者:
/**
 * Gets notifications from other apps.
 * In order to work to must enable the access of notifications in your device settings
 *
 * @param callback
 * @status TOREVIEW
 */
@ProtoMethod
public void onNewNotification(final ReturnInterface callback) {
    if (!isNotificationServiceRunning()) {
        showNotificationsManager();
    }

    onNotification = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            ReturnObject ret = new ReturnObject();

            ret.put("package", intent.getStringExtra("package"));
            ret.put("title", intent.getStringExtra("title"));
            ret.put("text", intent.getStringExtra("text"));

            callback.event(ret);
        }
    };

    LocalBroadcastManager.getInstance(getContext()).registerReceiver(onNotification, new IntentFilter("Msg"));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号