diff --git a/app/src/main/java/de/hampager/dapnetmobile/MainActivity.java b/app/src/main/java/de/hampager/dapnetmobile/MainActivity.java index d8ec87c..2eae687 100644 --- a/app/src/main/java/de/hampager/dapnetmobile/MainActivity.java +++ b/app/src/main/java/de/hampager/dapnetmobile/MainActivity.java @@ -256,8 +256,8 @@ public void onFailure(Call call, Throwable t) { String s = ""; s += "App v"; s += BuildConfig.VERSION_NAME; - mNavHeadVersions.setText(s); - + if(mNavHeadVersions!=null) + mNavHeadVersions.setText(s); } public void onNavHeaderSelected(View view) { diff --git a/app/src/main/java/de/hampager/dapnetmobile/PostCallActivity.java b/app/src/main/java/de/hampager/dapnetmobile/PostCallActivity.java index 0847732..b2563aa 100644 --- a/app/src/main/java/de/hampager/dapnetmobile/PostCallActivity.java +++ b/app/src/main/java/de/hampager/dapnetmobile/PostCallActivity.java @@ -82,7 +82,6 @@ protected void onCreate(Bundle savedInstanceState) { } private void defineObjects() { - Log.i("TEST", "TEST"); message = (TextInputEditText) findViewById(R.id.post_call_text); Switch emergency = (Switch) findViewById(R.id.post_call_emergencyswitch); String m = user.toUpperCase(); @@ -143,7 +142,7 @@ public int compare(CallSignResource o1, CallSignResource o2) { @Override public void onFailure(Call> call, Throwable t) { // something went completely wrong (e.g. no internet connection) - Log.e(TAG, t.getMessage()); + Log.e(TAG, "Error... Do you have internet? "+ t.getMessage()); } }); } @@ -247,7 +246,7 @@ public int compare(TransmitterGroupResource o1, TransmitterGroupResource o2) { @Override public void onFailure(Call> call, Throwable t) { // something went completely wrong (e.g. no internet connection) - Log.e(TAG, t.getMessage()); + Log.e(TAG, "Error... Do you have internet? "+ t.getMessage()); } }); } diff --git a/app/src/main/java/de/hampager/dapnetmobile/fragments/WelcomeFragment.java b/app/src/main/java/de/hampager/dapnetmobile/fragments/WelcomeFragment.java index db77c62..dd59be1 100644 --- a/app/src/main/java/de/hampager/dapnetmobile/fragments/WelcomeFragment.java +++ b/app/src/main/java/de/hampager/dapnetmobile/fragments/WelcomeFragment.java @@ -115,7 +115,9 @@ public void onResponse(Call call, Response respons public void onFailure(Call call, Throwable t) { // something went completely wrong (e.g. no internet connection) Log.e(TAG, "Fatal connection error.. "+t.getMessage()); - Snackbar.make(getActivity().findViewById(R.id.container), "Fatal connection error.. "+t.getMessage(), Snackbar.LENGTH_LONG).show(); + if(getActivity()!=null&&getActivity().findViewById(R.id.container)!=null) { + Snackbar.make(getActivity().findViewById(R.id.container), "Fatal connection error.. " + t.getMessage(), Snackbar.LENGTH_LONG).show(); + } } }); }