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

  • Home
  • SEARCH
  • 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 7630179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:02:14+00:00 2026-05-31T06:02:14+00:00

I’m going by the following code example to dynamically build a preference activity. http://www.linuxtopia.org/online_books/android/devguide/guide/samples/ApiDemos/src/com/example/android/apis/app/PreferencesFromCode.html

  • 0

I’m going by the following code example to dynamically build a preference activity.

http://www.linuxtopia.org/online_books/android/devguide/guide/samples/ApiDemos/src/com/example/android/apis/app/PreferencesFromCode.html

The preference dialog shows, but I’m not able to see any changes after closing it.

Here’s where I’m defining the activity in AndroidManifest.xml

    <activity 
          android:name="PreferencesActivity" android:label="@string/preferences_name">
    </activity>

Here’s where I’m defining the receiver.

    <receiver
            android:name="FroyVisualReceiver"
            android:label="@string/app_name"
            android:exported="false">
            <intent-filter>
                <action android:name="com.starlon.froyvisuals.PREFS_UPDATE"/>
            </intent-filter>
    </receiver>

And here’s the BroadcastReceiver. I never see the “WTF” in logcat. What am I doing wrong?

package com.starlon.froyvisuals;

import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.Context;
import android.util.Log;

public class FroyVisualsReceiver extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent)
    {
        Log.e("WTFWTF", "WTFWTFWTFW");
        String action = intent.getAction();
        if(action.equals("com.starlon.froyvisuals.PREFS_UPDATE"))
        {
            ((FroyVisuals)context).updatePrefs();
        }
    }
}

Oh here’s onPause where I’m broadcasting the PREFS_UPDATE intent.I do see the logcat message. This method is part of my PreferenceActivity.

    /** another activity comes over this activity */
    @Override
    public void onPause()
    {
        Log.i(TAG, "onPause ================================ ");
        super.onPause();
        Intent i = new Intent(this, FroyVisualsReceiver.class);
        i.setAction("com.starlon.froyvisuals.PREFS_UPDATE");
        sendBroadcast(i);
    }

Edit: I think it may have to do with this line. ‘this’ points to my PreferenceActivity.

Intent i = new Intent(this, FroyVisualsReceiver.class);
  • 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-31T06:02:15+00:00Added an answer on May 31, 2026 at 6:02 am

    Try a simple Intent:

     Intent i = new Intent();
     i.setAction("com.starlon.froyvisuals.PREFS_UPDATE");
     sendBroadcast(i);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
i got an object with contents of html markup in it, for example: string
I would like to count the length of a string with PHP. The string

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.