Code example for RemoteViews

0
  } 
 
  abstract protected int getLayoutId(); 
 
  protected RemoteViews getView(Context context) {
    return new RemoteViews(context.getPackageName(), getLayoutId());
  } 
 
  protected String buildWidgetString(Context context) {
    try { 
      ScheduleService schedule_service = App.li.getScheduleService();
      Schedule schedule = schedule_service.getNextSchedule();
 
      String schedule_str = context.getText(R.string.no_schedule).toString();
      if (schedule != null) {
        StringBuffer str_buf = new StringBuffer();
        str_buf.append(schedule.getChannel());
        str_buf.append("\n");
        str_buf.append(schedule.getStartString());
        str_buf.append("\n");
        str_buf.append(schedule.getName());