FileDocCategorySizeDatePackage
BluetoothMapFolderListing.javaAPI DocAndroid 5.1 API2097Thu Mar 12 22:22:50 GMT 2015android.bluetooth.client.map

BluetoothMapFolderListing

public class BluetoothMapFolderListing extends Object

Fields Summary
private static final String
TAG
private final ArrayList
mFolders
Constructors Summary
public BluetoothMapFolderListing(InputStream in)


       
        mFolders = new ArrayList<String>();

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

        return mFolders;
    
public voidparse(java.io.InputStream in)


        try {
            XmlPullParser xpp = XmlPullParserFactory.newInstance().newPullParser();
            xpp.setInput(in, "utf-8");

            int event = xpp.getEventType();
            while (event != XmlPullParser.END_DOCUMENT) {
                switch (event) {
                    case XmlPullParser.START_TAG:
                        if (xpp.getName().equals("folder")) {
                            mFolders.add(xpp.getAttributeValue(null, "name"));
                        }
                        break;
                }

                event = xpp.next();
            }

        } catch (XmlPullParserException e) {
            Log.e(TAG, "XML parser error when parsing XML", e);
        } catch (IOException e) {
            Log.e(TAG, "I/O error when parsing XML", e);
        }