Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:46:20+00:00 2026-05-24T06:46:20+00:00

I have defined an App Widget ( AppWidgetProvider , etc.), and I want to

  • 0

I have defined an App Widget (AppWidgetProvider, etc.), and I want to write an ad hoc program for the onClick of one of the buttons in the App Widget. The documentation describes how to inflate a layout for the App Widget and how to set a particular action on a button (see RemoteViews.setOnClickPendingIntent()), but I don’t see a way to write an ad hoc OnClickListener() for the button in the way that we do for buttons in Activities.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:46:21+00:00Added an answer on May 24, 2026 at 6:46 am

    Short answer: you can’t. App Widgets are lightweight — Android does not want App Widgets to run ad hoc code because that code could slow down the App Widget framework. Instead, AppWidgetProviders are supposed to do the work of App Widgets. The communication between AppWidgetProvider and AppWidget is a) the provider can update the widget with a new layout and b) the elements of that layout can send intents, which the AppWidgetProvider or other Android components can intercept and process.

    See Adding behavior to individual items for an example of the AppWidgetProvider defining a custom Intent that it intercepts from its App Widget.

    @Shubh: I edited your original question to make it clearer — if you like the edit, you’ll need to permit the edit so that others can see it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have defined a config section in my app.config in the following way: <?xml
I have defined two endpoints in my App.Config file as <system.serviceModel> <services> <service name=HostDirectAddress.ITestService
I have an app widget which runs neatly. However, I am unable to highlight
I have a MVC app built with extJS 4. I want to disable a
I'm developing a Windows Phone application . I have defined this on App.xaml: <nav:UriMapping
I have an app which is a UITabBarController, I have defined two subviews Both
In my iPhone app I am developing, I have defined two windows: @interface The_NoteAppDelegate
i want to create a widget app that when added will start ConfigurationActivity which
I have ConnectionString defined in App.config file and I check the option not to
I have a little web app that uses the Facebook like widget. This page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.