Android RemoteViews - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android RemoteViews class.

This code example shows how to use the following methods:
        } 
 
        private ProgressNotification generatePreICS(OpNotification opn, int layout, TextViewIds viewIds) {
            Notification n = new Notification(opn.getDrawable(), opn.getTickerText(), currentTimeMillis());
 
            n.contentView = new RemoteViews(context.getApplicationContext().getPackageName(), layout);
 
            notificationStyles.getTitleAppearance().setOn(n.contentView, viewIds.title);
            StatusBarNotificationStyles.TextAppearance textAppearance = notificationStyles.getTextAppearance();
            textAppearance.setOn(n.contentView, viewIds.text);
            textAppearance.setOn(n.contentView, viewIds.info);
 
            n.contentView.setTextViewText(viewIds.title, opn.getEventTitle());
            n.contentView.setTextViewText(viewIds.text, opn.getEventDetail());
            n.contentView.setProgressBar(android.R.id.progress, 1, 0, true);
            return new ProgressNotification(n, viewIds);
        } 
 
        private static class ContentInfoTextViewSearchPredicate implements Predicate<View> {
            private int contentInfoTextViewId;
Full Snippet Info
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setTextViewText
	} 
 
	@Kroll.method 
	public void setTextViewText(int viewId, String text)
	{ 
		remoteViews.setTextViewText(viewId, text);
	} 
 
	@Kroll.method 
	public void setViewVisibility(int viewId, int visibility)
	{ 
		remoteViews.setViewVisibility(viewId, visibility);
	} 
 
	@Kroll.method 
	public void setChronometer(int viewId, long base, String format, boolean started)
	{ 
		remoteViews.setChronometer(viewId, base, format, started);
	} 
 
Full Snippet Info
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setOnClickPendingIntent
        active.putExtra(COMMAND, buttonCode);
         
        // Make this pending intent unique to prevent updating other intents 
        Uri data = Uri.withAppendedPath(Uri.parse(uri + "://widget/id/#"+buttonCode), String.valueOf(widgetId));	
		active.setData(data);
        remoteView.setOnClickPendingIntent(viewId, PendingIntent.getBroadcast(context, 0, active, PendingIntent.FLAG_UPDATE_CURRENT));
	} 
	 
} 
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageViewResource, setOnClickPendingIntent, setViewVisibility
            // SettingsAppWidgetProvider.logD(">> updateView IN. Widget: "+appWidgetId+" Button:"+buttonID); 
 
            // SettingsAppWidgetProvider.logD("updateView -> Is Visible"); 
 
            // Set it visible 
            views.setViewVisibility(buttonLayout, View.VISIBLE);
            if (buttonSep != null) {
                views.setViewVisibility(buttonSep, View.VISIBLE);
            } 
 
            // SettingsAppWidgetProvider.logD("updateView -> Will register Intent"); 
            // Register the Intent 
            views.setOnClickPendingIntent(buttonLayout,
                    getLaunchPendingIntent(context, appWidgetId, buttonID));
 
            // SettingsAppWidgetProvider.logD("updateView -> Set current Icon"); 
            // Update icon to the one set by updateState 
            views.setImageViewResource(buttonIcon, currentIcon);
 
            // SettingsAppWidgetProvider.logD("updateView -> Set current State"); 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: apply
        RemoteViews rv=(RemoteViews)i.getParcelableExtra(EXTRA_CONTENT); 
        ViewGroup frame=(ViewGroup)findViewById(android.R.id.content); 
 
        frame.removeAllViews(); 
 
        View pluginView=rv.apply(RemoteViewsHostActivity.this, frame); 
 
        frame.addView(pluginView); 
      } 
    } 
  }; 
} 
Full Snippet Info
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setEmptyView, setOnClickPendingIntent, setRemoteAdapter, setTextViewText, setViewVisibility
  } 
 
  private static RemoteViews getWidgetWithTitle(Context paramContext, String paramString, int paramInt1, int paramInt2)
  { 
    RemoteViews localRemoteViews = getBaseWithVisibleViews(paramContext, new int[] { 2131231184 });
    localRemoteViews.setEmptyView(2131231184, 2131231185);
    Intent localIntent = new Intent(paramContext, RecommendationsViewService.class);
    localIntent.setData(Uri.parse("content://market/factory/for/" + paramInt1));
    localIntent.putExtra("appWidgetId", paramInt1);
    localRemoteViews.setRemoteAdapter(2131231184, localIntent);
    if (!TextUtils.isEmpty(paramString))
    { 
      localRemoteViews.setTextViewText(2131231125, paramString.toUpperCase());
      localRemoteViews.setOnClickPendingIntent(2131230744, PendingIntent.getActivity(paramContext, 0, IntentUtils.createBrowseIntent(paramContext, DfeApiImpl.getRecommendationsBrowseUrl(paramInt2), paramString, paramInt2, "widget", true), 0));
      localRemoteViews.setViewVisibility(2131230744, 0);
    } 
    return localRemoteViews;
  } 
 
  private static void showAccountsNeeded(Context paramContext, int paramInt)
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageViewBitmap
		return null; 
	} 
	 
	@Override 
    protected void onPostExecute(Long result) {
		_contentView.setImageViewBitmap(_customLayoutImageContainer, _bitmap);
		_notif.contentView = _contentView;
		_nm.notify(_notifyId, _notif);
	} 
 
 
} 
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageViewResource, setOnClickPendingIntent, setViewVisibility
            // SettingsAppWidgetProvider.logD(">> updateView IN. Widget: "+appWidgetId+" Button:"+buttonID); 
 
            // SettingsAppWidgetProvider.logD("updateView -> Is Visible"); 
 
            // Set it visible 
            views.setViewVisibility(buttonLayout, View.VISIBLE);
            if (buttonSep != null) {
                views.setViewVisibility(buttonSep, View.VISIBLE);
            } 
 
            // SettingsAppWidgetProvider.logD("updateView -> Will register Intent"); 
            // Register the Intent 
            views.setOnClickPendingIntent(buttonLayout,
                    getLaunchPendingIntent(context, appWidgetId, buttonID));
 
            // SettingsAppWidgetProvider.logD("updateView -> Set current Icon"); 
            // Update icon to the one set by updateState 
            views.setImageViewResource(buttonIcon, currentIcon);
 
            // SettingsAppWidgetProvider.logD("updateView -> Set current State"); 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setOnClickPendingIntent, setTextViewText
            message = getResources().getText(res).toString();
        } 
        if (mRemoteViews == null || mRemoteViews.getLayoutId() != mRAlertLayout) {
            mRemoteViews = getRemoteView(mRAlertLayout);
        } 
        mRemoteViews.setTextViewText(mRAlertMessage, message);
        mManager.updateAppWidget(mWidget, mRemoteViews);
        Log.d("Widget.displayAlert", "Alert displayed with message: "+message);
 
    } 
 
    public void displayLoader(String message) {
        if (mRLoaderLayout == 0) {
            mRLoaderLayout = getResources().getIdentifier("widget_loader", "layout", getPackageName());
            mRLoaderMessage = getResources().getIdentifier("loadermessage", "id", getPackageName());
        } 
        if (message == null || message.length() == 0) {
            int res = getResources().getIdentifier("widget_loader", "string", getPackageName());
            message = getResources().getText(res).toString();
        } 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: updateAppWidget, setOnClickPendingIntent, setTextViewText
	 */ 
	protected abstract ComponentName getComponentName();
	 
	@Override 
	public void onStart(Intent intent, int startId) {
		RemoteViews updateViews = new RemoteViews(this.getPackageName(), getLayoutID());
		updateViews.setTextViewText(getButtonID(), getNetInfoText(this));
 
		Intent settingIntent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
		PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
				settingIntent, 0);
		updateViews.setOnClickPendingIntent(getButtonID(), pendingIntent);
		AppWidgetManager.getInstance(this).updateAppWidget(getComponentName(),
				updateViews);
		super.onStart(intent, startId);
	} 
 
	@Override 
	public IBinder onBind(Intent arg0) {
		return null; 
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android RemoteViews Questions & Answers:

See Code Examples for Android RemoteViews Methods: