store descriptions

This commit is contained in:
jens 2022-06-06 20:06:11 +02:00
parent f738e02b72
commit 2361c758c9
2 changed files with 32 additions and 13 deletions

View File

@ -197,7 +197,16 @@ public class Actions
{
Miscellaneous.logEvent("i", "sendBroadcast", "Sending broadcast with action " + action, 5);
Intent broadcastIntent = new Intent();
broadcastIntent.setAction(action);
if(action.contains(Action.actionParameter2Split))
{
String[] parts = action.split(Action.actionParameter2Split);
broadcastIntent.setAction(parts[0]);
add params
}
else
broadcastIntent.setAction(action);
context.sendBroadcast(broadcastIntent);
}

View File

@ -51,6 +51,7 @@ public class ActivityManageActionSendBroadcast extends Activity
intentTypeSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, ActivityManageActionSendBroadcast.supportedIntentTypes);
spinnerParameterType.setAdapter(intentTypeSpinnerAdapter);
intentTypeSpinnerAdapter.notifyDataSetChanged();
intentPairAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, intentPairList);
bSaveSendBroadcast.setOnClickListener(new View.OnClickListener()
{
@ -61,7 +62,19 @@ public class ActivityManageActionSendBroadcast extends Activity
{
Intent answer = new Intent();
answer.putExtra(ActivityManageRule.intentNameActionParameter2, etBroadcastToSend.getText().toString());
String param2 = etBroadcastToSend.getText().toString();
if(intentPairList.size() > 0)
{
param2 += Action.actionParameter2Split;
for (String s : intentPairList)
param2 += s + ";";
param2 = param2.substring(0, param2.length() - 1);
}
answer.putExtra(ActivityManageRule.intentNameActionParameter2, param2);
setResult(RESULT_OK, answer);
finish();
}
@ -101,20 +114,17 @@ public class ActivityManageActionSendBroadcast extends Activity
String[] params = param2Parts[1].split(";");
if(startIndex > -1 && params.length > startIndex)
intentPairList.clear();
for(int i = 0; i < params.length; i++)
{
intentPairList.clear();
if(lvIntentPairs.getVisibility() != View.VISIBLE)
lvIntentPairs.setVisibility(View.VISIBLE);
for(int i=startIndex; i<params.length; i++)
{
if(lvIntentPairs.getVisibility() != View.VISIBLE)
lvIntentPairs.setVisibility(View.VISIBLE);
intentPairList.add(params[i]);
}
updateIntentPairList();
intentPairList.add(params[i]);
}
updateIntentPairList();
}
}