BaseAdapter ListView and SectionIndexer

by pedr0 » Tue, 08 Feb 2011 17:47:42 GMT

Sponsored Links
 Hi at all,

I wrote an BaseAdapter which implement the SectionIndexer interface
and all work fine, I can switch my index section using the
setFastScrollingEnabled(true) of my ListView, the only issues is that
the box of my letter index, which normally (in the Contacts app for
example) are displayed in the bottom center of the screen, are
displayed at the left top corner and drew with the color white: can I
customize the position of the letter box?

Thanks in advance.



Other Threads

1. Service Binding Problems - ServiceConnection.onServiceConnected not being called


As a point of example for my problem, I wrote a single Activity which
binds to a service and then accesses a property to display.  The
problem is that my TestServiceConnection.onServiceConnected method is
never called, and I don't know why.

Here is the code:

public class TestService extends Service
        private final IBinder binder = new TestServiceBinder();

        public IBinder onBind(Intent intent)
                return binder;

        public String getAProperty()
                return "Here's my property!";

        public class TestServiceBinder extends Binder
                TestService getService()
                        return TestService.this;

public class TestServiceConnection implements ServiceConnection
        protected TestService testService = null;

        public void onServiceConnected(ComponentName name, IBinder service)
                testService = 

        public void onServiceDisconnected(ComponentName name)
                testService = null;

public class RootActivity extends Activity
        private TestServiceConnection gsc = null;

        protected void onCreate(Bundle savedInstanceState)

                TextView tv = (TextView)findViewById(;

                gsc = new TestServiceConnection();

                Intent bindIntent = new Intent(this, TestService.class);
                bindService(bindIntent, gsc, Context.BIND_AUTO_CREATE);

                String p = "Unable to access TestService!";

                if (gsc.testService != null)
                        p = gsc.testService.getAProperty();


My manifest contains the following line for the service:

<service android:enabled="true" android:name="com.wm.TestService" />

Finally, here's my main layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="

- Mike

2. Gallery Child Count Problem

I have run into an interesting problem using the Gallery Object.  I am
doing some custom gesture detection in an onFling() method and get a
null view object when the index of the view I am trying to get is 6 or

The following line of code works fine for positions 0 - 5 but
closeView is always null with positions 6+:

int pos = m_runningGallery.pointToPosition((int)e1.getX(), (int)e1.getY
View closeView = m_runningGallery.getChildAt(pos);

In doing some debugging, it looks like the gallery object ALWAYS
reports 6 children, regardless of the number of children actually in
the view.

Has anyone else encountered this problem and/or found a solution to

Thanks in advance,


3. New moderation making this list very difficult to read.

4. New moderation making this list very difficult to read.

5. ]]

6. WebView Catch 22 - Same Window, Except For New Domain

7. Retreiving Preferences