Android 2.1 Sensors with screen off

by Jamie » Mon, 15 Feb 2010 21:41:13 GMT

Sponsored Links

I am writing an application for the Nexus One where I require the
accelerometer and/or the orientation sensor to remain active while the
screen is off. I have taken a partial wake lock, but it is quite clear
that as soon as the screen goes off any sensor updates stop.

I have searched this forum and it appears this was an issue previously
which was fixed in Cupcake. Is this a new bug in 2.1 or is this a
limitation of the handset (or even a deliberate design decision?)

Thanks in advance,



Other Threads

1. Problem after implementing SQLiteOpenHelper

I have a ListActivity that uses a CursorAdapter to fill the rows in
the view. I wrote a database helper class that gives me back results
for common queries I make for my app, and it uses an SQLiteOpenHelper
implementation I wrote to open the database. I use the open helper to
open the database and get a cursor to pass to my CursorAdapter. Here's
a code snippet:

public static Cursor getCursor(DbOpenHelper openHelper) {
        SQLiteDatabase db = openHelper.getWritableDatabase();
        Cursor c = null;
        try {
                String sql = "select * from " + TABLE_NAME;
            c = db.rawQuery(sql, null);
        } catch (SQLException e) {
                Log.e("Exception on query", e.toString());
            } finally {

            return c;

The problem I'm having, that I didn't have before I implemented the
open helper (before I just opened the database directly without a
helper), is when I click on an item, which takes me to another
activity, and then go back to this activity. When it initializes
everything is fine, and my list is populated fine, but when I go back
from the activity that follows, the list is empty and in the LogCat I
see "Invalid statement in fillWindow()".

It appears from a few post I've seen that the reason is, when I
requery the cursor, the database is closed. But I'm not closing it!
I'm scratching my head on this one.


2. Integrating the timer with my game


I m making an android game in which i have to make a timer , now I
developed the timer as a separate module and now when Im trying to
integrate , the images of the game dont show and only a black screen
is visible with the timer , im printing the time in textview


3. gpstest for emulator is not working

4. Official Yahoo! Apps!

5. Fwd: gdata calendar not working with android.

6. normal-hdpi screened emulator thinks it's a large screened emulator

7. Samsung-Galaxy-S-Pro