StatusHandler.java :  » UnTagged » vlcmote » com » victorvieux » android » handlers » Android Open Source

Android Open Source » UnTagged » vlcmote 
vlcmote » com » victorvieux » android » handlers » StatusHandler.java
package com.victorvieux.android.handlers;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class StatusHandler extends DefaultHandler {
  private String current = new String();
  private boolean playing = false;    
  
  @Override
     public void startElement(String ns, String sName, String qName,
        Attributes attrs) throws SAXException {
        current = sName;
     }
  
  @Override
     public void characters(char buf[], int offset, int len)
        throws SAXException {
    String content = new String(buf, offset, len);
    if (current.equals("state")) {
         if (content.equals("playing")) {
           playing = true;
         }
  
       }
     }
  
  public boolean isPlaying() {
    return playing;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.