How to determine when SCREEN_OFF_TIMEOUT has changed?

by Mike Bautista » Thu, 14 Jan 2010 04:05:15 GMT


Sponsored Links
 I'm trying to make my first widget that toggles the screen time out
settings.  Is there a way for the widget to be notified when
Settings.System.SCREEN_OFF_TIMEOUT has been changed?  I would like to
know this so I can update the widget graphic accordingly.



How to determine when SCREEN_OFF_TIMEOUT has changed?

by Dianne Hackborn » Thu, 14 Jan 2010 04:19:07 GMT


 Sorry there is no notification for this.




>


Sponsored Links


How to determine when SCREEN_OFF_TIMEOUT has changed?

by Mike Bautista » Fri, 15 Jan 2010 12:35:28 GMT


 Thanks for the response.  So what would be the best way to insure that
the state of Settings.System.SCREEN_OFF_TIMEOUT and the view on my
widget stay consistent?  It seems like the only way would be to poll
the setting every X minutes, but perhaps there's a more optimal way?





> >



Other Threads

1. Cost of requestLocationUpdates

If I use the intent-based requestLocationUpdates using a time period of,
say, 60 minutes I would expect that would be minimally 'expensive' in
terms of resources.  I expect that, internally, Android only queries for
the new location at the expired time interval.  But since you also have
to specify a distance trigger doesn't that mean that Android is
continually checking to see if you have moved the required distance?
And if that's the case does it make any difference whether I specify 5,
10, or 100 miles as the trigger?

-- 
Jake Colman -- Android Tinkerer

-- 

2. Looking for information on the Fragment dump() method (FragmentManager too)

Both of these classes have a dump() method which looks useful for
debugging. I tried to use them in a sample application, but I'm not
getting any output at all. My code looks like this from within my
activity:

        public void dumpFragmentMgr() {
                FragmentManager fm = getFragmentManager();
                File dumpFile = new 
File(Environment.getExternalStorageDirectory() +
                        "/fmdump.txt");
                if(dumpFile.exists()) {
                        dumpFile.delete();
                }
                try {
                    FileOutputStream fos = new FileOutputStream(dumpFile, true);
                    fm.dump("DIALOG", fos.getFD(), new PrintWriter(fos),
                                null);
                    fos.flush();
                    fos.close();
                } catch (FileNotFoundException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }

I'm positive that I have fragments in my fragment manager. My output
file is always empty, although I can see the datetimestamp getting
updated. I'm always passing null for the 4th argument to dump() since
I have no idea what else to put there. I have enableDebugLogging set
to true. Any help please?

-- 

3. Beta Game Space Bike

4. Clear data from MediaStore

5. Draw Image next to text on canvas

6. Maps not working in the android emulator

7. noob question I guess - input requires enter key