public override RemoteViews getViewAt(int position) { // TODO Auto-generated method stub RemoteViews contentView = new RemoteViews(mContext.PackageName, R.layout.widget_item); Bundle extras = new Bundle(); Intent fillInIntent = new Intent(); if ((position % 2) == 0) { PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_DIAL), PendingIntent.FLAG_UPDATE_CURRENT); extras.putParcelable(Constants.EXTRA_CONTENT_INTENT, pIntent); fillInIntent.putExtras(extras); contentView.setOnClickFillInIntent(R.id.widget_item_layout, fillInIntent); } else { Intent intent = new Intent(Intent.ACTION_VIEW); intent.Type = "vnd.android-dir/mms-sms"; PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); extras.putParcelable(Constants.EXTRA_CONTENT_INTENT, pIntent); fillInIntent.putExtras(extras); contentView.setOnClickFillInIntent(R.id.widget_item_layout, fillInIntent); } try { contentView.setTextViewText(R.id.tv_item, mDbHelper.getData(position)); } catch (System.IndexOutOfRangeException) { } return(contentView); }
public override RemoteViews getViewAt(int position) { // TODO Auto-generated method stub RemoteViews contentView = new RemoteViews(mContext.PackageName, R.layout.widget_item); Bundle extras = new Bundle(); Intent fillInIntent = new Intent(); if ((position % 2) == 0) { PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, new Intent(Intent.ACTION_DIAL), PendingIntent.FLAG_UPDATE_CURRENT); extras.putParcelable(Constants.EXTRA_CONTENT_INTENT, pIntent); fillInIntent.putExtras(extras); contentView.setOnClickFillInIntent(R.id.widget_item_layout, fillInIntent); } else { Intent intent = new Intent(Intent.ACTION_VIEW); intent.Type = "vnd.android-dir/mms-sms"; PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); extras.putParcelable(Constants.EXTRA_CONTENT_INTENT, pIntent); fillInIntent.putExtras(extras); contentView.setOnClickFillInIntent(R.id.widget_item_layout, fillInIntent); } try { contentView.setTextViewText(R.id.tv_item, mDbHelper.getData(position)); } catch (System.IndexOutOfRangeException) { } return contentView; }
public override void onUpdate(Context context, SlookCocktailManager cocktailBarManager, int[] cocktailIds) { // create RemoteViews RemoteViews rv = new RemoteViews(context.PackageName, R.layout.feeds_panel_layout); string str = context.Resources.getString([email protected]_contents); // set text in RemoteViews rv.setTextViewText(R.id.text, str + " at " + CurrentDate); // update cocktail for (int i = 0; i < cocktailIds.Length; i++) { cocktailBarManager.updateCocktail(cocktailIds[i], rv); } }