Added but not use; try to use contract, unsuccessfully. Keep fil just in casse

This commit is contained in:
jacques 2022-03-06 10:48:05 +01:00
parent 6a120afd84
commit 0b3a4c8a12

View file

@ -0,0 +1,39 @@
package net.foucry.pilldroid;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public class DrugDetailContract extends ActivityResultContract<Intent, Integer> {
/**
* Create an intent that can be used for {@link Activity#startActivityForResult}
*
* @param context Context
* @param input Drug
*/
@NonNull
@Override
public Intent createIntent(@NonNull Context context, Intent input) {
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("Drug", input.getExtras());
return (intent);
}
/**
* Convert result obtained from to O
* @param resultCode Integer
* @param intent Intent
* @return Integer
*/
@Override
public Integer parseResult(int resultCode, @Nullable Intent intent) {
return resultCode;
}
}