nextcloud / nextcloud/android

Intents are not type safe

Open
#5,866 2 comments 3 reactions 0 assignees View on GitHub
enhancement technical debt
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

As we had this recently: https://github.com/nextcloud/android/pull/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.