简体   繁体   English

手机收到通知后如何在没有任何用户交互的情况下自动打开 Android 应用程序

[英]How I can Open Android Application Automatically Once The Phone Received notification Without any user interaction

我搜索如何在没有用户交互的情况下自动打开 Android 应用程序一旦应用程序收到 FCM,我知道逻辑会将它放在方法 onMessageReceived 上,我不知道应用程序将如何在没有用户按下通知的情况下打开活动,应用程序自动打开

in your methods onMessageReceived() write somting like在您的方法 onMessageReceived() 中编写类似

Intent dialogIntent = new Intent(TrackingService.this, RequestView.class);
                            dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            startActivity(dialogIntent);

here is my full code in github but the start activity method will be good but take care you have to add the FLAG_ACTIVITY_NEW_TASK as i did in the above code to open activity when the app is close这是我在github 中的完整代码,但是 start Activity 方法会很好,但是请注意您必须像我在上面的代码中所做的那样添加 FLAG_ACTIVITY_NEW_TASK 以在应用程序关闭时打开 Activity

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序运行时无需任何用户交互 - Application runs without any user interaction 如何保存我的Android应用程序,以便最终用户可以在没有Android SDK的情况下执行它 - How can I save my Android application so that the end-user can execute it without the Android SDK Android:需要用户交互/输入的通知 - Android: Notification that requires user interaction / input 如何在Android中没有安装任何应用程序的情况下打开doc和ppt文件? - How can I open doc and ppt files without any app installed in device in Android? Android - 当收到推送通知 FCM 时,如何更新我的活动中的数据或 UI? - Android - How can I update data or UI in my Activity when Push Notification FCM is received? 在后台收到通知时,如何让我的android应用执行代码? - How can I get my android app to execute code when a notification is received when it's in background? Android 手机:如何使用 Appium 在不安装的情况下简单地打开应用程序(因为它已经安装) - Android phone: How to simply open an application without installation (as it is already installed) using Appium 如何在没有用户交互的情况下以编程方式卸载Android应用程序? - How to uninstall an Android app programmatically without user interaction? paintcomponent重复自身,无需任何用户交互 - paintcomponent repeats itself without any user interaction 如何在给定时间后自动运行 android 应用程序 - How can I automatically run an android application after a given time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM