startService() experiments

This commit is contained in:
jens 2023-11-05 16:20:48 +01:00
parent 64b97c650d
commit f24c9f99dc
2 changed files with 11 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
@ -1080,6 +1081,14 @@ public class Actions
if (!params[0].equals(dummyPackageString))
externalActivityIntent.setPackage(params[0]);
externalActivityIntent.setPackage("net.christianbeier.droidvnc_ng");
if (params[2].equals(ActivityManageActionStartActivity.startByServiceString))
{
//externalActivityIntent.setComponent(new ComponentName(params[0], params[1]));
externalActivityIntent.setComponent(new ComponentName("net.christianbeier.droidvnc_ng", ".MainService"));
}
externalActivityIntent.setAction(params[1]);
}
@ -1091,7 +1100,8 @@ public class Actions
if (params[2].equals(ActivityManageActionStartActivity.startByActivityString))
automationServerRef.startActivity(externalActivityIntent);
if (params[2].equals(ActivityManageActionStartActivity.startByServiceString))
automationServerRef.startService(externalActivityIntent);
//automationServerRef.startService(externalActivityIntent);
automationServerRef.startForegroundService(externalActivityIntent);
else
automationServerRef.sendBroadcast(externalActivityIntent);
}

View File

@ -90,7 +90,6 @@ public class ActivityManageActionStartActivity extends Activity
intentTypeSpinnerAdapter.notifyDataSetChanged();
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
bSelectApp.setOnClickListener(new OnClickListener()
{
@Override