mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Added but not use; try to use contract, unsuccessfully. Keep fil just in casse
This commit is contained in:
parent
6a120afd84
commit
0b3a4c8a12
1 changed files with 39 additions and 0 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue