You are talking about this part, right!!

  ListView pairedListView = (ListView) findViewById(R.id.paired_devices);
        pairedListView.setAdapter(mPairedDevicesArrayAdapter);

        // Find and set up the ListView for newly discovered devices
        ListView newDevicesListView = (ListView)
findViewById(R.id.new_devices);
        newDevicesListView.setAdapter(mNewDevicesArrayAdapter);


and then:


        if (pairedDevices.size() > 0) {

findViewById(R.id.title_paired_devices).setVisibility(View.VISIBLE);

            for (BluetoothDevice device : pairedDevices) {
                mPairedDevicesArrayAdapter.add(device.getName() + "\n" +
device.getAddress());
            }

        } else {
            String noDevices =
getResources().getText(R.string.none_paired).toString();
            mPairedDevicesArrayAdapter.add(noDevices);
        }
    }



----> that is to add the new detected BT devices to the array.



On Tue, Feb 14, 2012 at 2:45 AM, Kostya Vasilyev <[email protected]> wrote:

> 14 февраля 2012 г. 2:37 пользователь Indicator Veritatis <
> [email protected]> написал:
>
>
>> So the REAL question is: why are you trying to call addView on an
>> AdapterView?
>>
>>
> He's not, the framework is -- since the ListView in the XML has children
> (and one of those is another ListView, oh my).
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to