Skip to content

Intents are not type safe #5866

@tobiasKaminsky

Description

@tobiasKaminsky

As we had this recently: #5857

To prevent this, my idea is to have a static "launch" function in ever needed activity, that handles creating the intent correctly.
In this case it could be:

public static function launch/createIntent(File file, Account account) {
Intent i = new Intent(fileActivity, ConflictsResolveActivity.class);
i.putExtra(ConflictsResolveActivity.EXTRA_FILE, file);
i.putExtra(ConflictsResolveActivity.EXTRA_ACCOUNT, account);

return i;
}

What do you think? @ezaquarii @AndyScherzinger

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions