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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:38:49+00:00 2026-05-21T06:38:49+00:00

I’m trying to create a widget, and I’ve got the following error in my

  • 0

I’m trying to create a widget, and I’ve got the following error in my widget’s if I cancel(press back) in my configuration activity:

03-09 12:34:47.650: ERROR/AndroidRuntime(837): FATAL EXCEPTION: main
03-09 12:34:47.650: ERROR/AndroidRuntime(837): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=5, result=-1, data=Intent { act=CANCELED (has extras) }} to activity {com.android.launcher/com.android.launcher2.Launcher}: java.lang.NullPointerException
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3515)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3557)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.ActivityThread.access$2800(ActivityThread.java:125)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.os.Looper.loop(Looper.java:123)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.ActivityThread.main(ActivityThread.java:4627)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at java.lang.reflect.Method.invokeNative(Native Method)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at java.lang.reflect.Method.invoke(Method.java:521)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at dalvik.system.NativeStart.main(Native Method)
03-09 12:34:47.650: ERROR/AndroidRuntime(837): Caused by: java.lang.NullPointerException
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at com.android.launcher2.Launcher.completeAddAppWidget(Launcher.java:889)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at com.android.launcher2.Launcher.onActivityResult(Launcher.java:542)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.Activity.dispatchActivityResult(Activity.java:3890)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3511)
03-09 12:34:47.650: ERROR/AndroidRuntime(837):     ... 11 more

I don’t know why it is caused.

Here my AndroidManifest.xml, I made everything like described in the android widget tutorial:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="eu.scilled.rss"
    android:versionCode="1"
    android:versionName="1.0"
>
    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:debuggable="true">
        <receiver android:name=".RSSWidgetProvider">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE"
                ></action>
            </intent-filter>
            <meta-data android:name="android.appwidget.provider"
                android:resource="@xml/widget_provider_metadata"
            ></meta-data>
        </receiver>
        <activity android:name=".activity.ConfigActivity">
            <intent-filter>
                <action yndroid:name="android.appwidget.action.APPWIDGET_CONFIGURE"></action>
            </intent-filter>
        </activity>
    </application>
</manifest>

and my widget_provider_metadata.xml:

<appwidget-provider
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:updatePeriodMillis="86400000"
    android:minHeight="72dp"
    android:initialLayout="@layout/widget_layout"
    android:minWidth="146dp" android:configure="eu.scilled.rss.activity.ConfigActivity">
</appwidget-provider>

The Question is, why this Error is showing up, and why I the widget provider cannot react on the ResultIntent fired from the configuration activity.

The activity source:

public class ConfigActivity extends Activity implements OnClickListener {
    private static final String TAG = (ConfigActivity.class).getCanonicalName();
    private int THIS_WIDGET_ID = AppWidgetManager.INVALID_APPWIDGET_ID;
    private Intent resultIntent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.v(TAG, "starting configuration activity");
        setContentView(R.layout.config_activity_layout);
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            THIS_WIDGET_ID = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
                    AppWidgetManager.INVALID_APPWIDGET_ID);
        }
        resultIntent = new Intent();
        resultIntent.putExtra("EXTRA_APPWIDGET_ID", THIS_WIDGET_ID);
        createResultIntent(false);
        Button b = (Button) findViewById(R.id.button1);
        b.setOnClickListener(this);
    }

    private void createResultIntent(boolean finished) {
        if (!finished) {
            resultIntent.setAction("CANCELED");
            setResult(RESULT_OK, resultIntent);
        } else {
            resultIntent.setAction("CONFIG_DONE");
            setResult(RESULT_CANCELED, resultIntent);
        }
    }

    @Override
    public void onClick(View v) {
        createResultIntent(true);
        finish();

    }

    @Override
    public void onBackPressed() {

        createResultIntent(false);
        finish();

    }
}
  • 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-21T06:38:50+00:00Added an answer on May 21, 2026 at 6:38 am

    At least, you messed things in createResultIntent(): it returns RESULT_OK when BACK button pressed, not RESULT_CANCELED. And I think you should remove resultIntent.setAction("XXX") according to this SDK example.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.