diff --git a/mobile/src/main/java/io/syslogic/github/fragment/PreferencesFragment.java b/mobile/src/main/java/io/syslogic/github/fragment/PreferencesFragment.java
index c833ff5e..d627ca98 100644
--- a/mobile/src/main/java/io/syslogic/github/fragment/PreferencesFragment.java
+++ b/mobile/src/main/java/io/syslogic/github/fragment/PreferencesFragment.java
@@ -112,7 +112,7 @@ public void onCreatePreferences(@Nullable Bundle savedInstanceState, @Nullable S
requireActivity().startActivityFromFragment(this, intent, 100);
return true;
} catch (ActivityNotFoundException e) {
- if (mDebug) {Log.e(LOG_TAG, "" + e.getMessage());}
+ if (mDebug) {Log.e(LOG_TAG, "ActivityNotFoundException: " + e.getMessage());}
return false;
}
});
@@ -182,7 +182,7 @@ private void chooseDirectory() {
try {
requestFileChooserResult.launch(intent);
} catch (ActivityNotFoundException e) {
- Log.e(LOG_TAG, "" + e.getMessage());
+ Log.e(LOG_TAG, "ActivityNotFoundException: " + e.getMessage());
}
}
diff --git a/mobile/src/main/java/io/syslogic/github/network/AccountAuthenticator.java b/mobile/src/main/java/io/syslogic/github/network/AccountAuthenticator.java
index 19985568..ff5fa28e 100644
--- a/mobile/src/main/java/io/syslogic/github/network/AccountAuthenticator.java
+++ b/mobile/src/main/java/io/syslogic/github/network/AccountAuthenticator.java
@@ -99,7 +99,7 @@ public Bundle addAccount(
* The result will contain either:
*
* - {@link AccountManager#KEY_INTENT}, or
- *
- {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the check succeeded, false otherwise
+ *
- {@link AccountManager#KEY_BOOLEAN_RESULT},
true
if the check succeeded, false
otherwise
* - {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to
* indicate an error
*
diff --git a/mobile/src/main/java/io/syslogic/github/network/TokenHelper.java b/mobile/src/main/java/io/syslogic/github/network/TokenHelper.java
index 178410fa..bdc3b3a8 100644
--- a/mobile/src/main/java/io/syslogic/github/network/TokenHelper.java
+++ b/mobile/src/main/java/io/syslogic/github/network/TokenHelper.java
@@ -19,14 +19,15 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+
import io.syslogic.github.BuildConfig;
import io.syslogic.github.Constants;
+import io.syslogic.github.R;
import io.syslogic.github.activity.AuthenticatorActivity;
import io.syslogic.github.activity.NavHostActivity;
import io.syslogic.github.api.GithubClient;
import io.syslogic.github.api.model.User;
import io.syslogic.github.fragment.HomeScreenFragment;
-import io.syslogic.github.fragment.HomeScreenFragmentDirections;
import retrofit2.Call;
import retrofit2.Callback;
@@ -89,6 +90,7 @@ public static String getUsername(@NonNull Context context) {
}
}
+ @Nullable
private static String loadTokenFromPackageMeta(@NonNull Activity activity, AccountManager accountManager) {
String token = null;
try {
@@ -137,8 +139,7 @@ public void onResponse(@NonNull Call call, @NonNull Response respons
if (activity instanceof NavHostActivity activity2) {
if (activity2.getCurrentFragment() instanceof HomeScreenFragment) {
activity2.getNavController().navigate(
- HomeScreenFragmentDirections
- .actionHomeScreenFragmentToPreferencesFragment()
+ R.id.action_homeScreenFragment_to_preferencesFragment
);
}
}
@@ -156,7 +157,8 @@ public void onFailure(@NonNull Call call, @NonNull Throwable t) {
}
}
} catch (NullPointerException | PackageManager.NameNotFoundException e) {
- e.printStackTrace();
+ Log.e(LOG_TAG, e.getClass().getSimpleName() + ": " + e.getMessage());
+ return null;
}
return token;
}