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 6355869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:51:10+00:00 2026-05-24T22:51:10+00:00

The background image of a widget I’ve created in an application has suddenly stopped

  • 0

The background image of a widget I’ve created in an application has suddenly stopped appearing. Additionally, the widget no longer appears to respond to click events when I run the application in an emulator. Here are the Android project files:

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.widgetexample"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="-4" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".ConfigureActivity">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>
        <receiver android:name="WidgetProvider">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
            <meta-data android:name="android.appwidget.provider"
                android:resource="@xml/widgetprovider" />
        </receiver>
    </application>
</manifest>

res/xml/widgetprovider.xml

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:minWidth="72dp"
    android:minHeight="72dp"
    android:updatePeriodMillis="0"
    android:initialLayout="@layout/widget"
    android:configure="com.widgetexample.ConfigureActivity">
</appwidget-provider>

res/layout/widget.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Button
        android:id="@+id/widget_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:background="@drawable/widget_background" />
</LinearLayout>

src/com/widgetexample/WidgetProvider.java

package com.widgetexample;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;

public class WidgetProvider extends AppWidgetProvider {
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        for (int widgetIndex = 0; widgetIndex < appWidgetIds.length; widgetIndex++) {
            int appWidgetId = appWidgetIds[widgetIndex];
            Intent intent = new Intent(context, ConfigureActivity.class);
            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
            RemoteViews mRemoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);
            mRemoteViews.setOnClickPendingIntent(R.id.widget_button, pendingIntent);
            appWidgetManager.updateAppWidget(appWidgetId, mRemoteViews);
        }
    }
}

src/com/widgetexample/ConfigureActivity.java and res/drawable/widget_background.png both exist. I am able to open the latter in a standard image viewer. When executed, the widget appears as in this screenshot: https://i.stack.imgur.com/b43Ya.png. The logcat output is rather long to include here, but this is one line I noticed that appears relevant.

08-22 19:04:46.182: WARN/AppWidgetHostView(100): can't inflate defaultView because mInfo is missing

This error does appear in the Android source for android.appwidget.AppWidgetHostView, but I’m not certain how to correct the issue and Google is providing little useful information about the error.

Has anyone else experienced this or found a fix? I’m able to replicate this issue with a brand new project and all references to source files and resources appear consistent, so I’m wondering if the issue isn’t specific to my development environment. Any and all feedback is appreciated.

  • 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-24T22:51:13+00:00Added an answer on May 24, 2026 at 10:51 pm

    At the suggestion of a colleague, I tried nuking and recreating my AVD. For some reason, this appeared to fix the problem. The widget image is now found and properly displayed.

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

Sidebar

Related Questions

I am trying to create an application that has a background image with widget
I have a sidebar widget that has an image background. Over this is a
How to change cell background image on click on cell in iphone????I have tried
I set a background image(JPEG) on a Qt widget using setStyleSheet() . This is
I've been trying to set a background image on a gtk widget without success,
I'm making a custom widget in Qt, and drawing an image as its background.
BACKGROUND-IMAGE: url(../images/feedback_trans_tab.png); _background-image: url(../images/feedback_tab_ie6.png) I've seen code like this in a css file feedback_tab_ie6.png
.myDiv { background-image: url(urltomyimgheader); height:100px; margin: auto; position:relative; top:-10px; width:600px; } This is a
I have a tiling background image, but I want to overlay another tiling image
Trying to create a background-image slideshow and am getting this error... This is the

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.