diff --git a/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt b/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt
index f854a11..868c3a7 100644
--- a/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt
+++ b/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt
@@ -1,6 +1,7 @@
package io.heckel.ntfy.msg
import android.app.*
+import android.content.ActivityNotFoundException
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
@@ -9,6 +10,7 @@ import android.media.RingtoneManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
+import android.widget.Toast
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import io.heckel.ntfy.R
@@ -256,7 +258,6 @@ class NotificationService(val context: Context) {
}
val pendingIntent = PendingIntent.getActivity(context, Random().nextInt(), intent, PendingIntent.FLAG_IMMUTABLE)
builder.addAction(NotificationCompat.Action.Builder(0, action.label, pendingIntent).build())
-
} catch (e: Exception) {
Log.w(TAG, "Unable to add open user action", e)
}
@@ -366,7 +367,7 @@ class NotificationService(val context: Context) {
class ViewActionWithClearActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- Log.d(TAG, "Creating $this")
+ Log.d(TAG, "Created $this")
val url = intent.getStringExtra(VIEW_ACTION_EXTRA_URL)
val notificationId = intent.getIntExtra(VIEW_ACTION_EXTRA_NOTIFICATION_ID, 0)
if (url == null) {
@@ -382,6 +383,10 @@ class NotificationService(val context: Context) {
startActivity(intent)
} catch (e: Exception) {
Log.w(TAG, "Unable to start activity from URL $url", e)
+ val message = if (e is ActivityNotFoundException) url else e.message
+ Toast
+ .makeText(this, getString(R.string.detail_item_cannot_open_url, message), Toast.LENGTH_LONG)
+ .show()
}
// Cancel notification
diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt
index 7c62745..3b055dd 100644
--- a/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt
+++ b/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt
@@ -589,7 +589,7 @@ class DetailActivity : AppCompatActivity(), ActionMode.Callback, NotificationFra
Log.w(TAG, "Cannot open click URL", e)
runOnUiThread {
Toast
- .makeText(this@DetailActivity, getString(R.string.detail_item_cannot_open_click_url, e.message), Toast.LENGTH_LONG)
+ .makeText(this@DetailActivity, getString(R.string.detail_item_cannot_open_url, e.message), Toast.LENGTH_LONG)
.show()
}
}
diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt
index bc5f5c3..a9dbc50 100644
--- a/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt
+++ b/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt
@@ -441,6 +441,10 @@ class DetailAdapter(private val activity: Activity, private val lifecycleScope:
context.startActivity(intent)
} catch (e: Exception) {
Log.w(TAG, "Unable to start activity from URL ${action.url}", e)
+ val message = if (e is ActivityNotFoundException) action.url else e.message
+ Toast
+ .makeText(context, context.getString(R.string.detail_item_cannot_open_url, message), Toast.LENGTH_LONG)
+ .show()
}
}
diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml
index 91d6183..af4e5a2 100644
--- a/app/src/main/res/values-bg/strings.xml
+++ b/app/src/main/res/values-bg/strings.xml
@@ -279,7 +279,7 @@
Прикаченият файл не може да бъде отворен: Или е премахнат, или липсва приложение, с което да бъде отворен.
Прикаченият файл не може да бъде запазен: %1$s
Прикаченият файл не може да бъде премахнат: %1$s
- Адресът не може да бъде посетен: %1$s
+ Адресът не може да бъде посетен: %1$s
Прикаченият файл не може да бъде изтеглен: %1$s
не е изтеглен
не е изтеглен, препратката е с изтекла валидност
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index a215962..ab60ced 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -88,7 +88,7 @@
Uloženo jako \"%1$s\" do složky \"Stažené\"
Nelze otevřít přílohu: %1$s
Nelze otevřít přílohu: Soubor mohl být smazán nebo jej nemůže otevřít žádná nainstalovaná aplikace.
- Nelze otevřít URL: %1$s
+ Nelze otevřít URL: %1$s
Nelze uložit přílohu: %1$s
Nelze smazat přílohu: %1$s
Nepodařilo se stáhnout přílohu: %1$s
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 849812e..7e65c61 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -90,7 +90,7 @@
Wurde als \"%1$s\" im Downloads-Ordner gespeichert
Anhang kann nicht geöffnet oder heruntergeladen werden. Link ist abgelaufen und keine lokale Datei gefunden.
Anhang kann nicht geöffnet werden: %1$s
- URL kann nicht geöffnet werden: %1$s
+ URL kann nicht geöffnet werden: %1$s
Anhang kann nicht gespeichert werden: %1$s
Anhang kann nicht gelöscht werden: %1$s
Herunterladen des Anhangs fehlgeschlagen: %1$s
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 4b483d0..4560608 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -71,7 +71,7 @@
Notificación copiada al portapapeles
Guardado como %1$s en la carpeta de Descargas
No se puede abrir el archivo adjunto: %1$s
- No se pudo abrir la URL: %1$s
+ No se pudo abrir la URL: %1$s
No se puede guardar el archivo adjunto: %1$s
No se puede eliminar el archivo adjunto: %1$s
No se pudo descargar el archivo adjunto: %1$s
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 395434a..bc961a5 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -43,7 +43,7 @@
Télécharger un fichier
Annuler le téléchargement
Copier l\'URL
- Incapable d\'ouvrir l\'URL : %1$s
+ Incapable d\'ouvrir l\'URL : %1$s
pas téléchargé
supprimé
échec du téléchargement
diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml
index fb652e8..025bba3 100644
--- a/app/src/main/res/values-in/strings.xml
+++ b/app/src/main/res/values-in/strings.xml
@@ -211,7 +211,7 @@
URL Layanan
Berlangganan ke satu topik
Notifikasi disalin ke papan klip
- Tidak dapat membuka URL: %1$s
+ Tidak dapat membuka URL: %1$s
Menampilkan semua notifikasi
Tampilkan notifikasi jika prioritas adalah %1$d (%2$s) atau di atas
Unduh semua lampiran secara otomatis
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 13088cf..17e2740 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -73,7 +73,7 @@
Notifica copiata negli appunti
Impossibile aprire o scaricare l\'allegato. Il link è scaduto e nessun file locale è stato trovato.
Impossibile aprire l\'allegato: %1$s
- Impossibile aprire URL: %1$s
+ Impossibile aprire URL: %1$s
Impossibile eliminare l\'allegato: %1$s
Impossibile scaricare l\'allegato: %1$s
non scaricato
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 6b7f89b..18e5b78 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -121,7 +121,7 @@
ファイルを保存
URLをコピー
添付ファイルを開けません: ファイルが削除されているか、ファイルを開けるアプリがインストールされていません。
- URLを開けません: %1$s
+ URLを開けません: %1$s
添付ファイルを保存できません: %1$s
添付ファイルをダウンロードできません: %1$s
削除済
diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml
index c38aa24..ac1c130 100644
--- a/app/src/main/res/values-nb-rNO/strings.xml
+++ b/app/src/main/res/values-nb-rNO/strings.xml
@@ -72,7 +72,7 @@
Kan ikke åpne eller laste ned vedlegg. Lenken utløp og ingen lokal fil ble funnet.
Kan ikke åpne vedlegg: %1$s
Kan ikke åpne vedlegg: Filen kan ha blitt slettet, eller så mangler det et program til å åpne filen.
- Kan ikke åpne klikkbar nettadresse: %1$s
+ Kan ikke åpne klikkbar nettadresse: %1$s
Kan ikke slette vedlegg: %1$s
ikke nedlastet
%1$d%% nedlastet
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 656b140..fd74798 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -77,7 +77,7 @@
Notificação copiada para área de transferência
\"%1$s\" salvo na pasta \"Downloads\"
Não foi possível abrir ou baixar o anexo. O link expirou e nenhum arquivo local foi encontrado.
- Não foi possível abrir a URL: %1$s
+ Não foi possível abrir a URL: %1$s
Não foi possível salvar o anexo: %1$s
Não foi possível remover o anexo: %1$s
Não foi possível baixar o anexo: %1$s
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 5ba3364..f88a5e1 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -89,7 +89,7 @@
Удалить файл
Скачать файл
Отменить скачивание
- URL-адрес не открывается: %1$s
+ URL-адрес не открывается: %1$s
Выбрать
Отмена
Уведомления
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 6cee6c0..8841700 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -79,7 +79,7 @@
URL panoya kopyalandı
Bildirimi kopyala
Ek açılamıyor veya indirilemiyor. Bağlantının süresi doldu ve yerel dosya bulunamadı.
- URL açılamıyor: %1$s
+ URL açılamıyor: %1$s
Ek kaydedilemiyor: %1$s
Ek silinemiyor: %1$s
Ek indirilemedi: %1$s
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 0e7ca2c..249847b 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -164,7 +164,7 @@
通知已复制到剪贴板
无法打开附件:%1$s
无法打开附件:此文件已被删除或无可用打开方式。
- 无法打开 URL: %1$s
+ 无法打开 URL: %1$s
无法保存附件:%1$s
无法删除附件:%1$s
%1$s
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 5e63089..ac6e64d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -143,7 +143,7 @@
Cannot open or download attachment. The link expired and no local file could be found.
Cannot open attachment: %1$s
Cannot open attachment: The file may have been deleted, or no installed app can open the file.
- Cannot open URL: %1$s
+ Cannot open URL: %1$s
Cannot save attachment: %1$s
Cannot delete attachment: %1$s
Could not download attachment: %1$s