0

Android では、アプリを起動するサービスを作成しました。

Intent intent = context.getPackageManager().getLaunchIntentForPackage(pkg);
context.startActivity(intent);

これにより、「pkg」が前面に表示されます。

質問:このパッケージをバックグラウンドで起動する方法を教えてください。現在のフォアグラウンド アプリの使用を妨げません。

4

2 に答える 2

0

必要なのはServiceだと思います。Aは なしServiceの として機能します。ActivityView

于 2013-05-21T16:30:51.237 に答える
0

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.

于 2013-05-21T16:30:35.057 に答える