title: List in appwidget android
body: <p>i would like to show data as list in my app widget. But i am new with app widget so can you help me with any example or any references? Here is my code:</p>
  
  <p>public class AppWidget extends AppWidgetProvider  {</p>
  
  <pre><code>protected static final String file_name ="user";
  
    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager,
        int[] appWidgetIds) {
  
      // Get all ids
      ComponentName thisWidget = new ComponentName(context,
              AppWidget.class);
      int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget);
      for (int widgetId : allWidgetIds) {
  
        RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
            R.layout.widget_layout);
        //Get user name
        SharedPreferences settings = context.getSharedPreferences(file_name, 0);
        String name =  settings.getString("name", null);
        //Get data from database
        Database entry = new Database(context);
        entry.open();
        String[] myval=entry.planlist2(name);
        entry.close();
  
        // Set the text
        //remoteViews.setTextViewText(R.id.app_name, String.valueOf(number));
        remoteViews.setTextViewText(R.id.movie_name, Arrays.toString(myval).replaceAll("\\[|\\]", ""));
  
        // Register an onClickListener
        Intent intent = new Intent(context, AppWidget.class);
  
        intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
        intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
  
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
            0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
        remoteViews.setOnClickPendingIntent(R.id.app_name, pendingIntent);
        appWidgetManager.updateAppWidget(widgetId, remoteViews);
      }
  
    }
  
  } 
  </code></pre>
  
  <p>Now i want to show myval data as list.</p>