大家好 : ) 想请教各位前辈开发widget时有没有遇到过 "一开始update与一般运作都正常,但一段时间过后widget就被打回原型 (默认的layout),且完全不能点不能动" 的状况呢@@?? 因使用自己的手机做测试一直没有发生类似的问题,所以没有错误报告可以参考... 这两天也用了各种想到的关键字去google,找出以下可能的状况: 1. 将onUpdate里的动作移到Service执行,可避免它来不及做完 但若是使用者一开始有一段时间的update是可以正常执行的话, 是不是表示这段在onUpdate里面的code并不会太长呢...? 还是是我鸵鸟心态解读错误了... :p 2. 爬了板上的文章发现可能有pendingIntent flag设错的问题(?)导致widget不能点, 检查程式码之后确定flag设定应是正确的... 又回到一直觉得 "使用者一开始有一段时间可以正常使用" 的鸵鸟点@@ 3. google发现有可能是当手机内存不足时,appwidget provider被 "杀死" (?!) 但这个状况... 不才的原PO实在看不懂最后网友解决的方法是什么 囧 :) well I did that eventually, but i was thinking it to be a bad hack. I actually have 3 entities a WakeAliveService in my code, a WidgetUpdateService and the AppWidgetProvider. WakeAliveService sends periodic broadcasts which are picked up by the WidgetUpdateService to update the widgets in a list stored in ApplicationClass. AppWidgetProvider updates the list with ids in OnUpdate / OnDelete. When the widget id is updated the list is saved back to prefs. When Application starts again the list is read. On a reboot this list is cleared. DO you think this is a right approach ? 想请教大家不知有没有类似的开发经验可以分享呢@@... 也跪求关于上面英文的解读 T^T 呼~~ 真的还有很长一段的学习路要走 : ) 先说声谢谢大家 <(_ _)> 感恩~~~~