デフォルトのAndroidオプションにアクセスしたとき、つまりPlay MusicまたはGalleryにアクセスしたときに生成などを生成するときに、いくつかのサービスを実行したいアプリに取り組んでいますToast...これを行うことは可能ですか?これが私のコードです。
これが私がメインでサービスを開始する場所ですActivity:
if(autoBrightOn){
  startService(new Intent(this, MyService.class));
}
と私Service.class
public class MyService extends Service {
    private static final String TAG = "MyService";
    @Override
    public IBinder onBind(Intent intent) {
        Log.w(" ibinder ","");
        return null;
    }
    @Override
    public void onCreate() {
//        Toast.makeText(this, "My Service Created",0).show();
        Log.w(TAG, "onCreate");
            }
   @Override
    public void onDestroy() {
//        Toast.makeText(this, "My Service Stopped",0).show();
//        Log.w(TAG, "onDestroy");
//        player.stop();
    }
    @Override
    public void onStart(Intent intent, int startid) {
        Toast.makeText(this, "My Service Started :"+intent+" start id :"+startid,0).show();
//        Log.d(TAG, "onStart");
//        player.start();
        Intent intentBrowseFiles = new Intent(Intent.ACTION_VIEW);
      intentBrowseFiles.setType("image/*");
      intentBrowseFiles.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      startActivity(intentBrowseFiles);                   
    }