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. Launch Browser in maximised/minimised mode

Hi All,
I am launching browser by code:

                Intent myIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse(urlString));
                startActivity(myIntent);

as its working fine.

Now the issue is OEM behavior while launching it. My app is a network
app that registers with a server for some registration data and
depending on response acts accordingly eg if i get a URL in response
launch it otherwise launch default URL.

Case:
Launch my app on android simulator/device. Network communication
starts. While network process is in progress. Press 'Home' button on
device. Wait for some time.(say 10 seconds)

"Behaviour in Android emulator/device ver 1.6:"
Nothing will happen. But when now i click browser icon explicitly the
site I requested(URL from my server) will be displayed.

"Behaviour in Android emulator/device ver 2.2:"
Suddenly browser will launch and will start getting the content for
the URL (that I got from my server and launched browser).

So the difference is how the OEM is launching the activity. A1.6
launched it in background but A2.2 will launch it in foreground.

Can anyone help me can I pass on some parameters in startActivity so
that the behavior is uniform and I can control it rather than OEM
dependent.

Thanks
sam g

-- 

2. deploying AccountAuthenticator for multiple apps

How should I go about deploying the same AccountAuthenticator
for multiple projects that use the same kind of account?
Should each project include the AccountAuthenticator as a library-jar
or should it be it's own apk?
What happens if the same AccountAuthenticator is exported
from multiple apks in the system? Are they listed once or
multiple times (thus confusing the user)?


Marcus

-- 

3. Debug Native Code in eclipse

4. How do I capture and loop video to the screen?

5. how to implement handler pause on another activity running this activity finish next continue handler

6. Store Bitmap in Device, hence creating a file

7. Unable to run monkey for 40 Packages