我做了个appwidget 用listview绑定了列表 如何实现定时刷新,请高手指点!RemoteViewsService  代码
package com.example.samrun;
import entity.MyBean;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import android.widget.RemoteViews;
import android.widget.RemoteViewsService;
import java.util.ArrayList;import org.json.JSONArray;
import org.json.JSONObject;public class MyService extends RemoteViewsService { ArrayList<MyBean> mLists;

public IBinder onBind(Intent paramIntent)
  {
    return super.onBind(paramIntent);
  } public void onCreate() {
super.onCreate();
Log.i("update", "onCreate  in  MyService..");
} public RemoteViewsService.RemoteViewsFactory onGetViewFactory(Intent paramIntent)
  {
    Log.i("update", "onGetViewFactory  in  MyService..");
    return new MyRemoteViewsFactory(getApplicationContext(), paramIntent);
  } private class MyRemoteViewsFactory implements RemoteViewsService.RemoteViewsFactory {
Context mContext; public MyRemoteViewsFactory(Context paramIntent, Intent arg3) {
this.mContext = paramIntent;
} public int getCount() {
return MyService.this.mLists.size();
} public long getItemId(int paramInt) {
return paramInt;
} public RemoteViews getLoadingView() {
return null;
} public RemoteViews getViewAt(int paramInt) {
   Log.i("update", "getViewAt in MyRemoteViewsFactory..");

       RemoteViews localRemoteViews = new RemoteViews(this.mContext.getPackageName(), R.layout.item_layout);
       localRemoteViews.setTextViewText(R.id.title, ((MyBean)MyService.this.mLists.get(paramInt)).title);
       localRemoteViews.setTextViewText(R.id.time, ((MyBean)MyService.this.mLists.get(paramInt)).intime);
       Intent localIntent = new Intent();
       localIntent.putExtra("id", ((MyBean)MyService.this.mLists.get(paramInt)).id);
       localRemoteViews.setOnClickFillInIntent(R.id.item_llayout, localIntent);
       return localRemoteViews;
} public int getViewTypeCount() {
return 0;
} public boolean hasStableIds() {
return false;
} public void onCreate() {

Log.i("update", "onCreate in MyRemoteViewsFactory..");
MyService localMyService = MyService.this;
String jsonArray;
jsonArray = "0";
ArrayList<MyBean> localArrayList = new ArrayList<MyBean>();
    try
      {
     jsonArray = NetHelper.httpStringGet("");
     if(!jsonArray.equals("0")){
     Log.i("json", jsonArray);
     JSONArray localJSONArray = new JSONArray(jsonArray);
    for(int i = 0;i<localJSONArray.length();i++){
     JSONObject localJSONObject = localJSONArray.getJSONObject(i);
        MyBean localMyBean = new MyBean();
        String str1 = localJSONObject.getString("id");
        localMyBean.id = str1;
        String str2 = localJSONObject.getString("title");
        localMyBean.title = str2;
        String str3 = localJSONObject.getString("intime");
        localMyBean.intime = str3;
        localArrayList.add(localMyBean);
    }
     }
    }
    catch (Exception localException)
    {
        localException.printStackTrace();
    }
    localMyService.mLists = localArrayList;
Log.i("update", "onCreate  in  MyService-----MyRemoteViewsFactory..");
} public void onDataSetChanged() {

} public void onDestroy() {

}
}
}
AppWidgetProvider 代码如下
package com.example.samrun;import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.RemoteViews;public class MyAppWidgetProvider extends AppWidgetProvider {
public void onEnabled(Context paramContext)
  {
    super.onEnabled(paramContext);
  }

  public void onReceive(Context paramContext, Intent paramIntent)
  {
    super.onReceive(paramContext, paramIntent);
    Log.i("update", "onReceive");
  }

  public void onUpdate(Context paramContext, AppWidgetManager paramAppWidgetManager, int[] paramArrayOfInt)
  {
  Log.i("update", "onUpdate");
  super.onUpdate(paramContext, paramAppWidgetManager, paramArrayOfInt);
  RemoteViews localRemoteViews = new RemoteViews(paramContext.getPackageName(), R.layout.widget_layout);
  Intent localIntent = new Intent(paramContext, MyService.class);
  localIntent.putExtra("appWidgetId", paramArrayOfInt[0]);
  localRemoteViews.setRemoteAdapter(R.id.listView, localIntent);
  localRemoteViews.setPendingIntentTemplate(R.id.listView, PendingIntent.getActivity(paramContext, 0, new Intent(paramContext, TargetActivity.class), 0));
  paramAppWidgetManager.updateAppWidget(new ComponentName(paramContext, MyAppWidgetProvider.class), localRemoteViews);
  }
}
listviewappwidget定时更新定时