Android: links not opening
Links don't open on android:
https://user-images.githubusercontent.com/4956754/147910429-81f6511c-ebc1-417f-8294-ce2241eb864c.mp4
with a slight modification they work, still all the intent filtering on the app would stop working
diff --git a/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/Util.java b/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/Util.java
index 885bdf47..200d765a 100644
--- a/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/Util.java
+++ b/frontends/android/BitBoxApp/app/src/main/java/ch/shiftcrypto/bitboxapp/Util.java
@@ -1,5 +1,7 @@
package ch.shiftcrypto.bitboxapp;
+import static androidx.core.content.ContextCompat.startActivity;
+
import android.app.Application;
import android.content.Intent;
import android.net.Uri;
@@ -10,9 +12,7 @@ public class Util {
// https://developer.android.com/guide/components/intents-common.html#java
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- if (intent.resolveActivity(application.getPackageManager()) != null) {
- application.startActivity(intent);
- }
+ startActivity(application.getApplicationContext(), intent, null);
}
public static void log(String msg) {
https://user-images.githubusercontent.com/4956754/147911231-f4c9c831-85c3-45fe-95d0-977fe924eca6.mp4
with a slight modification they work, still all the intent filtering on the app would stop working
what does that mean exactly?
how did you figure out the code change? the previous code used to work - any idea why it stopped working? The linked page still has code exactly like it is in our app: https://developer.android.com/guide/components/intents-common.html#java
ping @BrianCraig
Update on this: it seems that since Android 11 package visibility has been reduced.
https://developer.android.com/training/package-visibility https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9
I opened a PR to fix this, see https://github.com/digitalbitbox/bitbox-wallet-app/pull/1793
PR merged, closing