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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:08:46+00:00 2026-05-31T13:08:46+00:00

I have been following various Widget Tutorials such as this one and this one

  • 0

I have been following various Widget Tutorials such as this one and this one

I have tried adapting their code to my purposes, and I have tried straight-up copy paste.
It seems no matter what I do, my widget NEVER gets updated. When it is placed on the home screen the text stays as the Static Text it was created with.
All I need this app to do is update 4 TextViews which will be contained in the layout.

The code below is mostly copied from one of the tutorials. I’ve tried debugging the onUpdate method, however the break point never seems to be hit.

Any help would be GREATLY appreciated.

EDIT: I reverted to a much simpler version of this widget that I was trying earlier in my efforts and replaced the code below with the code for the simpler widget. I made the changes suggested by CommonsWare to my manifest. Unfortunately the problem remains.

My main .java file looks like so:

public class NetStatWidget extends AppWidgetProvider 
{

public void onUpdate(Context context, AppWidgetManager manager, int[] appWidgetIds)
{   
    ComponentName thisWidget = new ComponentName(context, NetStatWidget.class);
    int[] widgetId = manager.getAppWidgetIds(thisWidget);

    RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.appwidget);
    remoteView.setTextViewText(R.id.textView0, "Hello");
    manager.updateAppWidget(widgetId, remoteView);
}

}

My Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.stat"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >


            <receiver android:name="NetStatWidget" >
                <intent-filter>
                    <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                </intent-filter>
                <meta-data 
                    android:name="android.appwidget.provider"
                    android:resource="@xml/providerinfo" />
            </receiver>

    </application>

</manifest>

And my Widget Provider Info:

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:initialLayout="@layout/main"
android:minWidth="146dip"
    android:minHeight="72dip"
    android:updatePeriodMillis="10000">

  • 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-31T13:08:47+00:00Added an answer on May 31, 2026 at 1:08 pm

    Your manifest is wrong. You are claiming that you have a network.widget.AppWidgetProvider class, and AFAIK, you don’t. You have an oddly-named network.widget.NetworkWidgetActivity class. You need to use that in your <receiver> element.

    Also:

    • Replace this.getApplicationContext() and getApplicationContext() with this

    • Unless you plan on doing more serious work in the service (database I/O, network I/O, etc.), consider just moving all that logic into onUpdate() and getting rid of the service, since it’s not really buying you much here (and if you are going to keep the service, switch to an IntentService and get rid of stopSelf() since that’s handled for you)

    • While you are asking for 10-second updates, the minimum effective updatePeriodMillis is 30 minutes — just keep that in mind while you are debugging

    • int[] widgetId seems to be unused in NetworkWidgetActivity

    • onStart() in a Service has been deprecated for a couple of years; use onStartCommand() instead

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

Sidebar

Related Questions

I have been trying various methods with no success to alter the following code...
I have been following some MVC tutorials that connect to a sql mdf database
Hi I am quite new to php but i have been following some tutorials
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I have been working on some code that is similar to the following: typedef
I have been following the usage of JavaScript for the past few years, and
I have been following the following post on using multiple ItemTemplates in a ListView
Recently I have started playing with jQuery, and have been following a couple of
I'm a newcomer to Rails, and have been following the tutorial on the rails
I have been given the following request. Please give 7% of the current contacts

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.