mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
logical start (not tested)
This commit is contained in:
parent
74534cbc17
commit
4cb82fda61
3 changed files with 6 additions and 9 deletions
|
@ -35,6 +35,7 @@ public class MedicamentDetailActivity extends AppCompatActivity {
|
|||
|
||||
/* fetching the string passed with intent using ‘extras’*/
|
||||
|
||||
assert extras != null;
|
||||
medicament = (Medicament) extras.getSerializable("medicament");
|
||||
|
||||
assert medicament != null;
|
||||
|
@ -150,6 +151,5 @@ public class MedicamentDetailActivity extends AppCompatActivity {
|
|||
medicament.setDateEndOfStock();
|
||||
|
||||
dbHelper.updateDrug(medicament);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ public class MedicamentDetailFragment extends Fragment {
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
assert getArguments() != null;
|
||||
if (getArguments().containsKey(ARG_ITEM_ID)) {
|
||||
// Load the dummy content specified by the fragment
|
||||
// arguments. In a real-world scenario, use a Loader
|
||||
|
|
|
@ -66,7 +66,6 @@ public class MedicamentListActivity extends AppCompatActivity {
|
|||
final Boolean DBDEMO = false;
|
||||
final static Random random = new Random();
|
||||
public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff;
|
||||
public final int SAVE_RQUEST_CODE = 0x000000ff;
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
|
@ -277,11 +276,9 @@ public class MedicamentListActivity extends AppCompatActivity {
|
|||
switch (requestCode) {
|
||||
case CUSTOMIZED_REQUEST_CODE: {
|
||||
Toast.makeText(this, "REQUEST_CODE = " + requestCode +"RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
}
|
||||
case SAVE_REQUEST_CODE: {
|
||||
Toast.makeText(this, "REQUEST_CODE = " + requestCode +"RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show();
|
||||
updateDrug();
|
||||
if (resultCode == 1) {
|
||||
constructMedsList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -462,7 +459,6 @@ public class MedicamentListActivity extends AppCompatActivity {
|
|||
Context context = v.getContext();
|
||||
Intent intent = new Intent(context, MedicamentDetailActivity.class);
|
||||
intent.putExtra("medicament", medicamentCourant);
|
||||
int requestCode = 0x0000ffff;
|
||||
startActivityForResult(intent, requestCode);
|
||||
}
|
||||
}
|
||||
|
@ -567,4 +563,4 @@ public class MedicamentListActivity extends AppCompatActivity {
|
|||
constructMedsList();
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue