ActivityResultLauncher<Intent> vpnLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
if (result.getResultCode() != Activity.RESULT_OK) {
app.startProxyService();
}
}
});
You can see how ugly this api is: redundant, repetitive, vague to understand.
Obviously It can be simplified like this:
Launcher<Intent> vpnLaucher = new Launcher().onResult((Result result) { .... })
not kotlin but kotlin colored 3
🤔 1
i
Ian Lake
09/27/2023, 5:06 PM
The split between the unconditional registration and the
The only problem is that Android is not good designed, components' parents are not recorded, and return data can not be send back to their parents by default.