Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个小部件应用程序,但我不知道如何从代码中检查是否以编程方式启用了小部件(放置在 HomeScreen 上)。
请帮我。
非常感谢。
您AppWidgetProvider有一种方法onEnabled可以设置布尔变量。看看这个答案https://stackoverflow.com/a/11815421/661079
AppWidgetProvider
onEnabled