Skip to content

Commit e45d536

Browse files
committed
Several bug fixes
1 parent bc7d1ca commit e45d536

File tree

11 files changed

+94
-8
lines changed

11 files changed

+94
-8
lines changed

app/src/main/java/de/htwBerlin/ois/viewModels/ViewModelMainActivity.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package de.htwBerlin.ois.viewModels;
22

33
import android.content.Intent;
4+
import android.os.Bundle;
45
import android.util.Log;
56
import android.widget.Toast;
67

@@ -98,7 +99,7 @@ public void getHttpResponse(String response)
9899
* @param intent the intent which started the MainActivity
99100
* @return FragmentHome.class or FragmentOptions.class
100101
*/
101-
public Class getCorrectFragment(Intent intent)
102+
public Class getCorrectFragment(Intent intent, Bundle savedInstanceState)
102103
{
103104

104105
if (intent.getStringExtra("Fragment") != null)
@@ -110,9 +111,15 @@ public Class getCorrectFragment(Intent intent)
110111
return FragmentOptions.class;
111112
}
112113
}
113-
return FragmentHome.class;
114-
114+
else
115+
{
116+
if (savedInstanceState == null)
117+
{
118+
return FragmentHome.class;
119+
}
120+
}
115121

122+
return null;
116123
}
117124

118125
public boolean isDarkModeEnabled()

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentAbout.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ public class FragmentAbout extends Fragment
4141
private View view;
4242

4343

44+
//------------Constructor------------
45+
46+
public FragmentAbout()
47+
{
48+
// doesn't do anything special
49+
}
50+
51+
4452
//------------Activity/Fragment Lifecycle------------
4553

4654
@Nullable

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentDownloadCenterAll.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ public class FragmentDownloadCenterAll extends FragmentWithServerConnection
6565

6666

6767
//------------Static Variables------------
68+
6869
/**
6970
* The view
7071
*/
7172
private View view;
7273

74+
7375
//------------Constructor------------
7476

77+
public FragmentDownloadCenterAll()
78+
{
79+
// doesn't do anything special
80+
}
81+
7582
public FragmentDownloadCenterAll(Client client)
7683
{
7784
this.client = client;

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentDownloadCenterCategories.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ public class FragmentDownloadCenterCategories extends FragmentWithServerConnecti
5252
private Client client;
5353

5454

55+
//------------Constructors------------
56+
57+
public FragmentDownloadCenterCategories()
58+
{
59+
// doesn't do anything special
60+
}
61+
62+
5563
//------------Activity/Fragment Lifecycle------------
5664

5765

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentFAQ.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ public class FragmentFAQ extends Fragment
3737
private View view;
3838

3939

40+
//------------Constructors------------
41+
42+
public FragmentFAQ()
43+
{
44+
// doesn't do anything special
45+
}
46+
47+
4048
//------------Activity/Fragment Lifecycle------------
4149

4250
@Nullable

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentHome.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ public class FragmentHome extends Fragment
6868
private RecyclerView localMapsRecyclerView;
6969

7070

71+
//------------Constructors------------
72+
73+
public FragmentHome()
74+
{
75+
// doesn't do anything special
76+
}
77+
7178
//------------Activity/Fragment Lifecycle------------
7279

7380
@Nullable

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentNavigation.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ public class FragmentNavigation extends Fragment
6666
private ViewModelNavigation viewModel;
6767

6868

69+
//------------Constructors------------
70+
71+
public FragmentNavigation()
72+
{
73+
// doesn't do anything special
74+
}
75+
76+
6977
//------------Activity/Fragment Lifecycle------------
7078

7179
@Override
@@ -93,7 +101,16 @@ public void onDestroy() {
93101
* Whenever your activity exits, some cleanup operations have to be performed lest your app
94102
* runs out of memory.
95103
*/
96-
mapView.destroyAll();
104+
try
105+
{
106+
//This sometimes throws a NullPointer
107+
mapView.destroyAll();
108+
}
109+
catch(NullPointerException e)
110+
{
111+
e.printStackTrace();
112+
}
113+
97114
AndroidGraphicFactory.clearResourceMemoryCache();
98115
super.onDestroy();
99116
}

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public class FragmentOptions extends Fragment
5050
public static String ID = "Options";
5151

5252

53+
//------------Constructors------------
54+
55+
public FragmentOptions()
56+
{
57+
// doesn't do anything special
58+
}
59+
60+
5361
//------------Instance Variables------------
5462

5563
/**

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentRequestNewMap.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public class FragmentRequestNewMap extends Fragment
5252

5353
//------------Constructors------------
5454

55+
public FragmentRequestNewMap()
56+
{
57+
// doesn't do anything special
58+
}
59+
5560
public FragmentRequestNewMap(HttpClient httpClient)
5661
{
5762
this.httpClient = httpClient;

app/src/main/java/de/htwBerlin/ois/views/fragments/FragmentRequestStatus.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ public class FragmentRequestStatus extends FragmentWithServerConnection
3838
private ViewModelRequestStatus viewModel;
3939

4040

41+
//------------Constructors------------
42+
43+
public FragmentRequestStatus()
44+
{
45+
// doesn't do anything special
46+
}
47+
48+
4149
//------------Activity/Fragment Lifecycle------------
4250

4351
@Override

0 commit comments

Comments
 (0)