/**
* 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"));
}
PDevice.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:phonk
作者:
评论列表
文章目录