本帖最后由 zxlworking1 于 2014-05-30 10:38:09 编辑

解决方案 »

  1.   

    你debug看下那个view,感觉应该是view没生成的原因,还有你的UpdateService 是不是写在内部类里面,那个里面this是不能指向context的
      

  2.   

    那个service是在onstart的时候进行更新,this是service的
      

  3.   


    那个service是在onstart的时候进行更新,this是service的 
      

  4.   

    那不就有问题了么new ComponentName(this, MyAppWidgetProvider.class)这里的this应该是包名吧
      

  5.   

    ComponentName的方法是这样的,我放this难道是不对的吗?
    android.content.ComponentName.ComponentName(Context pkg, Class<?> cls)Create a new component identifier from a Context and Class object.Parameters:
    pkg A Context for the package implementing the component, from which the actual package name will be retrieved.
    cls The Class object of the desired component, from which the actual class name will be retrieved.
      

  6.   

    这里Context pkg放的是包,你的this不是指向service么
      

  7.   


    你好,你看是这样填写吗?
    new ComponentName("com.example.my_widget_2","com.example.my_widget_2.UpdateService")
      

  8.   

    我知道了,是小米系统的bug,换成默认主题,就能动态更新了。
      

  9.   


    你好,你看是这样填写吗?
    new ComponentName("com.example.my_widget_2","com.example.my_widget_2.UpdateService")恩,我是这样写的