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.

pedr0


-- 



Other Threads

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

Hello,

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();

        @Override
        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;

        @Override
        public void onServiceConnected(ComponentName name, IBinder service)
        {
                testService = 
((TestService.TestServiceBinder)service).getService();
        }

        @Override
        public void onServiceDisconnected(ComponentName name)
        {
                testService = null;
        }
}

public class RootActivity extends Activity
{
        private TestServiceConnection gsc = null;

        @Override
        protected void onCreate(Bundle savedInstanceState)
        {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);

                TextView tv = (TextView)findViewById(R.id.mainText);

                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();
                }

                tv.setText(p);
        }
}

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="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:id="@+id/mainText"/>
</LinearLayout>

- 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
above.

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
this?

Thanks in advance,
Justin



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

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