Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

ServiceAction uses the same extra key when putting and getting action parameters #1268

Copy link
Copy link
@VladimirZhilyakov

Description

@VladimirZhilyakov
Issue body actions

There is a service that implements an action with multiple parameters:

@ServiceAction
void mySimpleAction(String param1, int param2, String param3) {
    Log.i("MyService", "mySimpleAction " + param1 + " " + param2 + " " + param3);
}

Run this action with some parameters

MyService_.intent(context).mySimpleAction("1", 2, "3").start();

the output will be "mySimpleAction 3 0 3".
Generated code:

if (ACTION_MY_SIMPLE_ACTION.equals(action)) {
    Bundle extras = intent.getExtras();
    if (extras!= null) {
        String param1Extra = extras.getString(PARAM_EXTRA);  // PARAM1_EXTRA?
        int param2Extra = extras.getInt(PARAM_EXTRA);        // PARAM2_EXTRA?
        String param3Extra = extras.getString(PARAM_EXTRA);  // PARAM3_EXTRA?
        super.mySimpleAction(param1Extra, param2Extra, param3Extra);
        return ;
    }
}
...
public MyService_.IntentBuilder_ mySimpleAction(String param1, int param2, String param3) {
    action(ACTION_MY_SIMPLE_ACTION);
    super.extra(PARAM_EXTRA, param1); // PARAM1_EXTRA?
    super.extra(PARAM_EXTRA, param2); // PARAM2_EXTRA?
    super.extra(PARAM_EXTRA, param3); // PARAM3_EXTRA?
    return this;
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.