Android では、アプリを起動するサービスを作成しました。
Intent intent = context.getPackageManager().getLaunchIntentForPackage(pkg);
context.startActivity(intent);
これにより、「pkg」が前面に表示されます。
質問:このパッケージをバックグラウンドで起動する方法を教えてください。現在のフォアグラウンド アプリの使用を妨げません。
Android では、アプリを起動するサービスを作成しました。
Intent intent = context.getPackageManager().getLaunchIntentForPackage(pkg);
context.startActivity(intent);
これにより、「pkg」が前面に表示されます。
質問:このパッケージをバックグラウンドで起動する方法を教えてください。現在のフォアグラウンド アプリの使用を妨げません。
必要なのはServiceだと思います。Aは なしService
の として機能します。Activity
View
You're certainly looking for a Service
. Service in Android is used to run operations in background and for longtime.
A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use.