Android app launch on background

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 22:37:21

问题


We're developing an Android app for a POS system. Our app forwards the user to an app of a payment provider (Adyen) to handle the payment:

Intent intent = new Intent("com.adyen.posregister.payment");
// Here goes some irrelevant intent config
startActivityForResult(intent, 1);

However, the only thing the Adyen app does is firing up the payment terminal (over bluetooth). We would like to keep our own app visible all the time.

Question: is it possible to launch an external app (the Adyen app in this case) from our app, while keeping our app on the foreground?

Best regards, Willem


回答1:


The common methods to ask another app to perform a task for you without displaying any UI would be:

  • Starting a Service

  • Sending a message to a BroadcastReceiver

If the component you are using does not require UI it would make sense for it to support either or both methods, but whether or not it actually does is a question for the vendor.

In general there is no method to start another activity, forcing it to display no UI and return right away. Whether that happens is up to the other activity.



来源:https://stackoverflow.com/questions/26445022/android-app-launch-on-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!