@@ -0,0 +1,2170 @@
+package com.sam_chordas.android.stockhawk.widget;%0A%0Aimport android.app.LauncherActivity;%0Aimport android.appwidget.AppWidgetManager;%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.widget.RemoteViews;%0Aimport android.widget.RemoteViewsService;%0A%0Aimport com.sam_chordas.android.stockhawk.R;%0A%0Aimport java.util.ArrayList;%0A%0A/**%0A * If you are familiar with Adapter of ListView,this is the same as adapter%0A * with few changes%0A *%0A *%0A * tutorial: https://laaptu.wordpress.com/2013/07/19/android-app-widget-with-listview/%0A */%0A%0Apublic class WidgetListProvider implements RemoteViewsService.RemoteViewsFactory %7B%0A     private ArrayList listItemList = new ArrayList();%0A     private Context context = null;%0A     private int appWidgetId;%0A%0A     public WidgetListProvider(Context context, Intent intent) %7B%0A         this.context = context;%0A         appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,%0A                 AppWidgetManager.INVALID_APPWIDGET_ID);%0A%0A%0A     %7D%0A%0A%0A%0A    @Override%0A    public void onCreate() %7B%0A%0A    %7D%0A%0A    @Override%0A    public void onDataSetChanged() %7B%0A%0A    %7D%0A%0A    @Override%0A    public void onDestroy() %7B%0A%0A    %7D%0A%0A    @Override%0A    public int getCount() %7B%0A        return listItemList.size()!=0 ? listItemList.size():0;%0A    %7D%0A%0A    /*%0A    *Similar to getView of Adapter where instead of View%0A    *we return RemoteViews%0A    *%0A    */%0A%0A    @Override%0A    public RemoteViews getViewAt(int position) %7B%0A        final RemoteViews remoteView = new RemoteViews(%0A                context.getPackageName(), R.layout.list_item_quote);%0A        LauncherActivity.ListItem listItem = (LauncherActivity.ListItem) listItemList.get(position);%0A        //remoteView.setTextViewText(R.id.stock_symbol, listItem.heading);%0A        //remoteView.setTextViewText(R.id.change, listItem.content);%0A%0A        return remoteView;%0A    %7D%0A%0A    @Override%0A    public RemoteViews getLoadingView() %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public int getViewTypeCount() %7B%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public long getItemId(int position) %7B%0A        return position;%0A    %7D%0A%0A    @Override%0A    public boolean hasStableIds() %7B%0A        return false;%0A    %7D%0A%7D%0A

add widget remote view service and remote views factory