From 413f12c3c23a87dfba1241a1ba5952fdcbe33f64 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Tue, 11 May 2021 19:45:28 +0900 Subject: [PATCH] parse locationId to long before setting to bundle. Fixes austinhuang0131/barinsta#1235 --- .../instagrabber/fragments/FavoritesFragment.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/FavoritesFragment.java b/app/src/main/java/awais/instagrabber/fragments/FavoritesFragment.java index 975357e8..a7804de0 100644 --- a/app/src/main/java/awais/instagrabber/fragments/FavoritesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/FavoritesFragment.java @@ -2,6 +2,7 @@ package awais.instagrabber.fragments; import android.content.Context; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -102,8 +103,13 @@ public class FavoritesFragment extends Fragment { // Log.d(TAG, "locationId: " + locationId); final NavController navController = NavHostFragment.findNavController(this); final Bundle bundle = new Bundle(); - bundle.putString("locationId", locationId); - navController.navigate(R.id.action_global_locationFragment, bundle); + try { + bundle.putLong("locationId", Long.parseLong(locationId)); + navController.navigate(R.id.action_global_locationFragment, bundle); + } catch (Exception e) { + Log.e(TAG, "init: ", e); + return; + } break; } case HASHTAG: {