FileDocCategorySizeDatePackage
BluetoothPbapVcardListing.javaAPI DocAndroid 5.1 API2073Thu Mar 12 22:22:50 GMT 2015android.bluetooth.client.pbap

BluetoothPbapVcardListing

public class BluetoothPbapVcardListing extends Object

Fields Summary
private static final String
TAG
ArrayList
mCards
Constructors Summary
public BluetoothPbapVcardListing(InputStream in)


         
        parse(in);
    
Methods Summary
public java.util.ArrayListgetList()

        return mCards;
    
private voidparse(java.io.InputStream in)

        XmlPullParser parser = Xml.newPullParser();

        try {
            parser.setInput(in, "UTF-8");

            int eventType = parser.getEventType();

            while (eventType != XmlPullParser.END_DOCUMENT) {

                if (eventType == XmlPullParser.START_TAG && parser.getName().equals("card")) {
                    BluetoothPbapCard card = new BluetoothPbapCard(
                            parser.getAttributeValue(null, "handle"),
                            parser.getAttributeValue(null, "name"));
                    mCards.add(card);
                }

                eventType = parser.next();
            }
        } catch (XmlPullParserException e) {
            Log.e(TAG, "XML parser error when parsing XML", e);
        }