Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion android/app/src/main/java/gallery/memories/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gallery.memories

import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.res.Configuration
import android.graphics.Color
Expand Down Expand Up @@ -230,7 +231,11 @@ class MainActivity : AppCompatActivity() {
}

// Open external links in browser
Intent(Intent.ACTION_VIEW, request.url).apply { startActivity(this) }
try {
Intent(Intent.ACTION_VIEW, request.url).apply { startActivity(this) }
} catch (e: ActivityNotFoundException) {
Toast.makeText(view.context, "No app found to open this link", Toast.LENGTH_SHORT).show()
}

return true
}
Expand Down