Skip to content
Snippets Groups Projects
Commit cbc291ee authored by Fabio Heyming's avatar Fabio Heyming
Browse files

Massig Bugfixes

parent 4cb7d41a
No related branches found
No related tags found
1 merge request!1Mal aufn Master megren
...@@ -23,6 +23,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -23,6 +23,7 @@ public class MainActivity extends AppCompatActivity {
binding = ActivityMainBinding.inflate(getLayoutInflater()); binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
MampfMobil meinMampf = new MampfMobil(binding.getRoot().getContext()); MampfMobil meinMampf = new MampfMobil(binding.getRoot().getContext());
// Hier wird die Bottom Navigation View ausgeblendet // Hier wird die Bottom Navigation View ausgeblendet
binding.navView.setVisibility(View.GONE); binding.navView.setVisibility(View.GONE);
...@@ -48,7 +49,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -48,7 +49,8 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
protected void onStop() { protected void onStop() {
Log.d("myTag", "This ONSTOP"); Log.d("myTag", "SAVED PERSISTANT");
MampfMobil.savePersistant();
super.onStop(); super.onStop();
} }
......
...@@ -153,8 +153,9 @@ private ActivityCustomerBinding binding; ...@@ -153,8 +153,9 @@ private ActivityCustomerBinding binding;
} }
@Override @Override
protected void onDestroy() { protected void onStop() {
Log.d("myTag", "This ONDESTROY CUSTOMER"); Log.d("myTag", "SAVED PERSISTANT");
super.onDestroy(); MampfMobil.savePersistant();
super.onStop();
} }
} }
\ No newline at end of file
...@@ -49,8 +49,9 @@ private ActivityDelivererBinding binding; ...@@ -49,8 +49,9 @@ private ActivityDelivererBinding binding;
} }
@Override @Override
protected void onDestroy() { protected void onStop() {
Log.d("myTag", "This ONDESTROYDELIVERER"); Log.d("myTag", "SAVED PERSISTANT");
super.onDestroy(); MampfMobil.savePersistant();
super.onStop();
} }
} }
\ No newline at end of file
...@@ -31,14 +31,19 @@ public class MampfMobil { ...@@ -31,14 +31,19 @@ public class MampfMobil {
public MampfMobil(Context context){ public MampfMobil(Context context){
this.context = context; this.context = context;
customers = new Vector<>();
deliverers = new Vector<>();
suppliers = new Vector<>();
takefromPersistance();
if(!isInitialized) { if(!isInitialized) {
customers = new Vector<>(); customers = new Vector<>();
deliverers = new Vector<>(); deliverers = new Vector<>();
suppliers = new Vector<>(); suppliers = new Vector<>();
takefromPersistance();
isInitialized = true;
}
/*if(!isInitialized) {
customers = new Vector<>();
deliverers = new Vector<>();
suppliers = new Vector<>();
//create Dummys!!! //create Dummys!!!
customers.add(new Customer("Fabio", "Heyming", "Weinbergstr 70, 55299 Nackenheim")); customers.add(new Customer("Fabio", "Heyming", "Weinbergstr 70, 55299 Nackenheim"));
...@@ -111,7 +116,7 @@ public class MampfMobil { ...@@ -111,7 +116,7 @@ public class MampfMobil {
suppliers.add(new Supplier("", "")); suppliers.add(new Supplier("", ""));
isInitialized = true; isInitialized = true;
savePersistant(); savePersistant();
} }*/
} }
public static boolean findCustomer(String vorname, String nachname){ public static boolean findCustomer(String vorname, String nachname){
...@@ -273,7 +278,6 @@ public class MampfMobil { ...@@ -273,7 +278,6 @@ public class MampfMobil {
} }
} }
String fileName6 = "bestellungen.csv"; String fileName6 = "bestellungen.csv";
Log.d("myTag", csvBestellungen);
CSVFileHelper.saveCSVFile(context, fileName6, csvBestellungen); CSVFileHelper.saveCSVFile(context, fileName6, csvBestellungen);
...@@ -401,7 +405,6 @@ public class MampfMobil { ...@@ -401,7 +405,6 @@ public class MampfMobil {
String fileName6 = "bestellungen.csv"; String fileName6 = "bestellungen.csv";
String csvData6 = CSVFileHelper.loadCSVFile(context, fileName6); String csvData6 = CSVFileHelper.loadCSVFile(context, fileName6);
Log.d("myTag", csvData6 );
if (csvData6 != null) { if (csvData6 != null) {
String[] lines = csvData6.split("\n"); String[] lines = csvData6.split("\n");
for (String line : lines) { for (String line : lines) {
...@@ -434,7 +437,7 @@ public class MampfMobil { ...@@ -434,7 +437,7 @@ public class MampfMobil {
Bestellung temp = new Bestellung(ID, tempSup, delivery, state, tempCus, delivererId); Bestellung temp = new Bestellung(ID, tempSup, delivery, state, tempCus, delivererId);
Log.d("myTag", data.length + " lang" );
for (int i = 6; i < data.length; i += 2) { for (int i = 6; i < data.length; i += 2) {
int ItemId = Integer.parseInt(data[i]); int ItemId = Integer.parseInt(data[i]);
int quantity = Integer.parseInt(data[i + 1]); int quantity = Integer.parseInt(data[i + 1]);
...@@ -447,7 +450,7 @@ public class MampfMobil { ...@@ -447,7 +450,7 @@ public class MampfMobil {
} }
} }
} }
Log.d("myTag", tempItem.name + quantity);
temp.addBestellungsteil(new BestellungsTeil(tempItem, quantity)); temp.addBestellungsteil(new BestellungsTeil(tempItem, quantity));
} }
......
...@@ -47,8 +47,9 @@ public class SupplierActivity extends AppCompatActivity { ...@@ -47,8 +47,9 @@ public class SupplierActivity extends AppCompatActivity {
} }
@Override @Override
protected void onDestroy() { protected void onStop() {
Log.d("myTag", "This ONDESTROYDELIVERER"); Log.d("myTag", "SAVED PERSISTANT");
super.onDestroy(); MampfMobil.savePersistant();
super.onStop();
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment