fix: home widget url (#517)

This commit is contained in:
lollipopkit🏳️‍⚧️
2024-08-04 00:17:21 +08:00
committed by GitHub
parent ea7c8caf14
commit 493c86cacb
6 changed files with 32 additions and 32 deletions

View File

@@ -27,8 +27,8 @@ class HomeWidget : AppWidgetProvider() {
private fun updateAppWidget(context: Context, appWidgetManager: AppWidgetManager, appWidgetId: Int) {
val views = RemoteViews(context.packageName, R.layout.home_widget)
val sp = context.getSharedPreferences("FlutterSharedPreferences", Context.MODE_PRIVATE)
var url = sp.getString("$appWidgetId", null)
val gUrl = sp.getString("*", null)
var url = sp.getString("widget_$appWidgetId", null)
val gUrl = sp.getString("widget_*", null)
if (url.isNullOrEmpty()) {
url = gUrl
}