Custom Preference and Focus

by Shaun » Thu, 09 Oct 2008 11:30:05 GMT


Sponsored Links
 I have a custom preference that is a container with a slider (SeekBar)
and some text. How can I get the slider to take focus when the list
item is highlighted (I want it to take focus so the user can use the
trackball to move the slider).

I've tried listening to the ListViews selection changes but the
SeekBar always refuses my requestFocus() calls.

Thx.

SPT
--~--~---------~--~----~------------~-------~--~----~



Custom Preference and Focus

by Jason Parekh » Thu, 09 Oct 2008 11:43:08 GMT


 Unfortunately the seek bar is missing trackball-functionality in 1.0.

If you still want to try to fit a slider inline with the preference, you
might use listView.setItemsCanFocus(false).  However, this may interfere
with CheckBoxPreferences.

Instead of this, I think you should pop up a DialogPreference with a seek
bar in there, similar to the brightness or volume settings.  It's one extra
level for the user to traverse, but it'll be a cleaner list of settings and
match the rest of the settings across the system.

jason





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. About screen rotation

Hello,

I tried to trace the screen rotation procedure.

I trace from application's andriodmanifest.xml
->ActivityManager
->WindowManager
->SurfaceFlinger
->???(Maybe Skia)
->???(Maybe Display Driver)

Can any experts give me some tips how to trace
after the SurfaceFlingfer?

Does it use Skia to do orientation?
After the skia, will it call display driver for orientation?

Many Many Thanks!!!
--~--~---------~--~----~------------~-------~--~----~

2. opening a file within a service

I'm getting some weird behavior when I try to open a file within a
service:

<code>

public class MyService extends Service{

public void onCreate(){
    super.onCreate();

    File myFile = getFileStreamPath("myfile.dat");

    if (myFile.exists()){
        Log.i("MyService", "myfile.dat exists");
    }

}

</code>

Whenever getFileStreamPath is called, the service just freezes and
does nothing.  It's like the call to getFileStremPath is being blocked
by something.

Can someone give an example of how to properly obtain a File object
reference in a service using getFileStreamPath()?

Thanks.

Richard

--~--~---------~--~----~------------~-------~--~----~

3. Live streaming of H.264 encoded file

4. Touchscreen not completely working

5. getting around Phoneapp activity 1.1?

6. BroadcastReceiver for data SMS - static works, dynamic does not

7. What are that XML Attributes in JAVA