title: Can not show Polyline on the Android
body: <p>Sorry with my English.</p>
  
  <p>I am developing my application about area detection.
  I want to detect the position of android device via GPS, when it on the Polyline,it will alert the user. So I want to keep the Polyline in Local Storage. </p>
  
  <p>But I do not know how to keep it?</p>
  
  <p>My solution is:</p>
  
  <ul>
  <li>I keep the start and end point(latitude,longitude) in my database and then I will send the argument to maps.google.com and access the node then writing the Document and create Polyline from the document</li>
  </ul>
  
  <p>Mistake
  - It can not run after click "Risk Zone" It show only marker on the map but do not show the Polyline. And It will crash.</p>
  
  <p>MainActivity</p>
  
  <pre><code>import java.io.IOException;
  import java.io.InputStream;
  import java.util.ArrayList;
  
  import javax.xml.parsers.DocumentBuilder;
  import javax.xml.parsers.DocumentBuilderFactory;
  import javax.xml.parsers.ParserConfigurationException;
  
  import org.apache.http.HttpResponse;
  import org.apache.http.client.ClientProtocolException;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.protocol.BasicHttpContext;
  import org.apache.http.protocol.HttpContext;
  
  import org.w3c.dom.Document;
  import org.w3c.dom.Node;
  import org.w3c.dom.NodeList;
  import org.xml.sax.SAXException;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.UiSettings;
  import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener;
  import com.google.android.gms.maps.GoogleMapOptions;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.BitmapDescriptor;
  import com.google.android.gms.maps.model.BitmapDescriptorFactory;
  import com.google.android.gms.maps.model.GroundOverlayOptions;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.Marker;
  import com.google.android.gms.maps.model.MarkerOptions;
  import com.google.android.gms.maps.model.PolylineOptions;
  
  import android.R.color;
  import android.content.Context;
  import android.graphics.BitmapFactory.Options;
  import android.graphics.Color;
  import android.location.Criteria;
  import android.location.Location;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  
  import android.util.Log;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.Toast;
  
  public class MainActivity extends FragmentActivity {
  
      GoogleMap mMap;  
      GoogleMapOptions option;
      double lat=0;
      double lng=0;   
      Direction md;
      LatLng fromPosition = new LatLng(13.687140112679154, 100.53525868803263);
      LatLng toPosition = new LatLng(13.683660045847258, 100.53900808095932);
      PolylineOptions rectLine;   
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
  
          mMap = ((SupportMapFragment)getSupportFragmentManager()
                          .findFragmentById(R.id.map)).getMap();
  
  
  
  
  
          Button buttonNormal = (Button) findViewById(R.id.button1);
          buttonNormal.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
              }
          });
  
          Button buttonSatellite = (Button) findViewById(R.id.button2);
          buttonSatellite.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
              }
          });
  
          Button buttonTerrain = (Button) findViewById(R.id.button3);
          buttonTerrain.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
              }
          });
  
          Button buttonHybrid = (Button) findViewById(R.id.button4);
          buttonHybrid.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
              }
          });
  
          Button buttonLocate = (Button) findViewById(R.id.button7);
          buttonLocate.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  Criteria criteria = new Criteria();
                  LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
                  String provider = locationManager.getBestProvider(criteria, false);
                  Location location = locationManager.getLastKnownLocation(provider);
                  double lat =  location.getLatitude();
                  double lng = location.getLongitude();
                  LatLng coordinate = new LatLng(lat, lng);
  
                  mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
                          (coordinate), 15));
                  mMap.addMarker(new MarkerOptions()
                          .position(coordinate)
                          .title("Prove")
                          .snippet("Family")
                          .draggable(true)
                          .icon(BitmapDescriptorFactory
                                  .defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));                
  
                  mMap.setOnMarkerClickListener(new OnMarkerClickListener() {
  
                      @Override
                      public boolean onMarkerClick(Marker arg0) {
                          // TODO Auto-generated method stub
                          arg0.remove();
                          Toast.makeText(getApplicationContext(),
                                  "Remove Marker" + String.valueOf(arg0.getId()),
                                  Toast.LENGTH_SHORT).show();
                          return false;
                      }
                  });
  
              }
          });
  
  
          /*Button buttonPoly = (Button) findViewById(R.id.button6);
          buttonPoly.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  PolylineOptions rectLine = new PolylineOptions().add(
                          new LatLng(lat, lng))
                          .add(new LatLng(lat + 0.00001, lng + 0.0001));
  
                  mMap.addPolyline(rectLine);
              }
          });*/
  
          Button buttonDest = (Button) findViewById(R.id.button5);
          buttonDest.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
  
                  LatLng coordinates = new LatLng(13.685400079263206, 100.537133384495975);       
                  mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(coordinates, 15));
  
                  mMap.addMarker(new MarkerOptions().position(fromPosition).title("Start"));
                  mMap.addMarker(new MarkerOptions().position(toPosition).title("End"));
  
                  md=new Direction();         
  
                  Document doc = md.getDocument(fromPosition, toPosition, md.MODE_DRIVING);
                  int duration = md.getDurationValue(doc);
                  String distance = md.getDistanceText(doc);
                  String start_address = md.getStartAddress(doc);
                  String copy_right = md.getCopyRights(doc);
  
                  ArrayList&lt;LatLng&gt; directionPoint = md.getDirection(doc);
                  PolylineOptions rectLine = new PolylineOptions().width(3).color(Color.RED);
  
                  for(int i = 0 ; i &lt; directionPoint.size() ; i++) {          
                      rectLine.add(directionPoint.get(i));
                  }
  
                  mMap.addPolyline(rectLine);
  
  
              }
          });
  
  
  
  
      }
  }   
  </code></pre>
  
  <p>Direction.java</p>
  
  <pre><code>import java.io.InputStream;
  import java.util.ArrayList;
  
  import javax.xml.parsers.DocumentBuilder;
  import javax.xml.parsers.DocumentBuilderFactory;
  
  import org.apache.http.HttpResponse;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.protocol.BasicHttpContext;
  import org.apache.http.protocol.HttpContext;
  import org.w3c.dom.Document;
  import org.w3c.dom.Node;
  import org.w3c.dom.NodeList;
  
  import android.util.Log;
  
  import com.google.android.gms.maps.model.LatLng;
  
  public class Direction {
      public final static String MODE_DRIVING = "driving";
      public final static String MODE_WALKING = "walking";
  
      public Direction(){
  
      }
  
      public Document getDocument(LatLng start, LatLng end, String mode) {
          String url = "http://maps.googleapis.com/maps/api/directions/xml?" 
                  + "origin=" + start.latitude + "," + start.longitude  
                  + "&amp;destination=" + end.latitude + "," + end.longitude 
                  + "&amp;sensor=false&amp;units=metric&amp;mode=driving";
  
          try {
              HttpClient httpClient = new DefaultHttpClient();
              HttpContext localContext = new BasicHttpContext();
              HttpPost httpPost = new HttpPost(url);
              HttpResponse response = httpClient.execute(httpPost, localContext);
              InputStream in = response.getEntity().getContent();
              DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
              Document doc = builder.parse(in);
              return doc;
          } catch (Exception e) {
              e.printStackTrace();
          }
          return null;
      }
  
      public String getDurationText (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("duration");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "text"));
          Log.i("DurationText", node2.getTextContent());
          return node2.getTextContent();
      }
  
      public int getDurationValue (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("duration");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "value"));
          Log.i("DurationValue", node2.getTextContent());
          return Integer.parseInt(node2.getTextContent());
      }
  
      public String getDistanceText (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("distance");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "text"));
          Log.i("DistanceText", node2.getTextContent());
          return node2.getTextContent();
      }
  
      public int getDistanceValue (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("distance");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "value"));
          Log.i("DistanceValue", node2.getTextContent());
          return Integer.parseInt(node2.getTextContent());
      }
  
      public String getStartAddress (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("start_address");
          Node node1 = nl1.item(0);
          Log.i("StartAddress", node1.getTextContent());
          return node1.getTextContent();
      }
  
      public String getEndAddress (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("end_address");
          Node node1 = nl1.item(0);
          Log.i("StartAddress", node1.getTextContent());
          return node1.getTextContent();
      }
  
      public String getCopyRights (Document doc) {
          NodeList nl1 = doc.getElementsByTagName("copyrights");
          Node node1 = nl1.item(0);
          Log.i("CopyRights", node1.getTextContent());
          return node1.getTextContent();
      }
  
      public ArrayList&lt;LatLng&gt; getDirection (Document doc) {
          NodeList nl1, nl2, nl3;
          ArrayList&lt;LatLng&gt; listGeopoints = new ArrayList&lt;LatLng&gt;();
          nl1 = doc.getElementsByTagName("step");
          if (nl1.getLength() &gt; 0) {
              for (int i = 0; i &lt; nl1.getLength(); i++) {
                  Node node1 = nl1.item(i);
                  nl2 = node1.getChildNodes();
  
                  Node locationNode = nl2.item(getNodeIndex(nl2, "start_location"));
                  nl3 = locationNode.getChildNodes();
                  Node latNode = nl3.item(getNodeIndex(nl3, "lat"));
                  double lat = Double.parseDouble(latNode.getTextContent());
                  Node lngNode = nl3.item(getNodeIndex(nl3, "lng"));
                  double lng = Double.parseDouble(lngNode.getTextContent());
                  listGeopoints.add(new LatLng(lat, lng));
  
                  locationNode = nl2.item(getNodeIndex(nl2, "polyline"));
                  nl3 = locationNode.getChildNodes();
                  latNode = nl3.item(getNodeIndex(nl3, "points"));
                  ArrayList&lt;LatLng&gt; arr = decodePoly(latNode.getTextContent());
                  for(int j = 0 ; j &lt; arr.size() ; j++) {
                      listGeopoints.add(new LatLng(arr.get(j).latitude, arr.get(j).longitude));
                  }
  
                  locationNode = nl2.item(getNodeIndex(nl2, "end_location"));
                  nl3 = locationNode.getChildNodes();
                  latNode = nl3.item(getNodeIndex(nl3, "lat"));
                  lat = Double.parseDouble(latNode.getTextContent());
                  lngNode = nl3.item(getNodeIndex(nl3, "lng"));
                  lng = Double.parseDouble(lngNode.getTextContent());
                  listGeopoints.add(new LatLng(lat, lng));
              }
          }
  
          return listGeopoints;
      }
  
      private int getNodeIndex(NodeList nl, String nodename) {
          for(int i = 0 ; i &lt; nl.getLength() ; i++) {
              if(nl.item(i).getNodeName().equals(nodename))
                  return i;
          }
          return -1;
      }
  
      private ArrayList&lt;LatLng&gt; decodePoly(String encoded) {
          ArrayList&lt;LatLng&gt; poly = new ArrayList&lt;LatLng&gt;();
          int index = 0, len = encoded.length();
          int lat = 0, lng = 0;
          while (index &lt; len) {
              int b, shift = 0, result = 0;
              do {
                  b = encoded.charAt(index++) - 63;
                  result |= (b &amp; 0x1f) &lt;&lt; shift;
                  shift += 5;
              } while (b &gt;= 0x20);
              int dlat = ((result &amp; 1) != 0 ? ~(result &gt;&gt; 1) : (result &gt;&gt; 1));
              lat += dlat;
              shift = 0;
              result = 0;
              do {
                  b = encoded.charAt(index++) - 63;
                  result |= (b &amp; 0x1f) &lt;&lt; shift;
                  shift += 5;
              } while (b &gt;= 0x20);
              int dlng = ((result &amp; 1) != 0 ? ~(result &gt;&gt; 1) : (result &gt;&gt; 1));
              lng += dlng;
  
              LatLng position = new LatLng((double) lat / 1E5, (double) lng / 1E5);
              poly.add(position);
          }
          return poly;
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
  
      xmlns:tools="http://schemas.android.com/tools"
  
  
  
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;fragment     
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
  
          class="com.google.android.gms.maps.SupportMapFragment"/&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;Button
              android:id="@+id/button1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/btn_normal"
              android:textSize="@dimen/textsize" /&gt;
  
          &lt;Button
              android:id="@+id/button2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/btn_satellite"
              android:textSize="@dimen/textsize" /&gt;
  
          &lt;Button
              android:id="@+id/button3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/btn_terrain"
              android:textSize="@dimen/textsize" /&gt;
  
          &lt;Button
              android:id="@+id/button4"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="@string/btn_hybrid"
              android:textSize="@dimen/textsize" /&gt;
  
          &lt;Button
              android:id="@+id/button7"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:text="@string/btn_locate"
              android:textSize="@dimen/textsize" /&gt;
  
          &lt;Button
              android:id="@+id/button5"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="@string/btn_destination"
              android:textSize="@dimen/textsize" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="app.Disthanitian.thaistyle.EmerMez"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission 
              android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;uses-permission android:name="com.example.googlemapsv2.permission.MAPS_RECEIVE"/&gt;
  
      &lt;permission 
          android:name="com.example.googlemapsv2.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/&gt;
  
      &lt;uses-feature android:glEsVersion="0x00020000" android:required="true"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name="app.Disthanitian.thaistyle.EmerMez.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;meta-data
             android:name="com.google.android.maps.v2.API_KEY"
             android:value="AIzaSyBzRmlT-LnuOeDHpxByJJVq8cxc39JTDGg"/&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Logcat</p>
  
  <pre><code>      06-06 10:35:34.032: I/ADM(1710): 2:   825935789: [INFO] hw_handler_u8500:849 Query: SELECT * FROM HW_Settings WHERE (Platform = 'AB8500') AND ('REF_Speaker_Playback_Music' IN (Dev1, Dev2, Dev3, Dev4, Dev5, Dev6))ORDER BY rowid LIMIT 1
  06-06 10:35:34.052: W/System.err(6196): android.os.NetworkOnMainThreadException
  06-06 10:35:34.052: W/System.err(6196):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
  06-06 10:35:34.052: W/System.err(6196):     at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
  06-06 10:35:34.052: W/System.err(6196):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
  06-06 10:35:34.062: W/System.err(6196):     at java.net.InetAddress.getAllByName(InetAddress.java:214)
  06-06 10:35:34.062: W/System.err(6196):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
  06-06 10:35:34.062: W/System.err(6196):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
  06-06 10:35:34.062: W/System.err(6196):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
  06-06 10:35:34.062: W/System.err(6196):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
  06-06 10:35:34.062: W/System.err(6196):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
  06-06 10:35:34.062: W/System.err(6196):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
  06-06 10:35:34.072: W/System.err(6196):     at app.Disthanitian.thaistyle.EmerMez.Direction.getDocument(Direction.java:41)
  06-06 10:35:34.072: W/System.err(6196):     at app.Disthanitian.thaistyle.EmerMez.MainActivity$6.onClick(MainActivity.java:175)
  06-06 10:35:34.072: W/System.err(6196):     at android.view.View.performClick(View.java:4162)
  06-06 10:35:34.072: W/System.err(6196):     at android.view.View$PerformClick.run(View.java:17082)
  06-06 10:35:34.072: W/System.err(6196):     at android.os.Handler.handleCallback(Handler.java:615)
  06-06 10:35:34.072: W/System.err(6196):     at android.os.Handler.dispatchMessage(Handler.java:92)
  06-06 10:35:34.072: W/System.err(6196):     at android.os.Looper.loop(Looper.java:137)
  06-06 10:35:34.072: W/System.err(6196):     at android.app.ActivityThread.main(ActivityThread.java:4867)
  06-06 10:35:34.072: W/System.err(6196):     at java.lang.reflect.Method.invokeNative(Native Method)
  06-06 10:35:34.082: W/System.err(6196):     at java.lang.reflect.Method.invoke(Method.java:511)
  06-06 10:35:34.082: W/System.err(6196):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
  06-06 10:35:34.082: W/System.err(6196):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
  06-06 10:35:34.082: W/System.err(6196):     at dalvik.system.NativeStart.main(Native Method)
  06-06 10:35:34.082: D/AndroidRuntime(6196): Shutting down VM
  06-06 10:35:34.082: W/dalvikvm(6196): threadid=1: thread exiting with uncaught exception (group=0x41c612a0)
  06-06 10:35:34.092: E/AndroidRuntime(6196): FATAL EXCEPTION: main
  06-06 10:35:34.092: E/AndroidRuntime(6196): java.lang.NullPointerException
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at app.Disthanitian.thaistyle.EmerMez.Direction.getDurationValue(Direction.java:62)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at app.Disthanitian.thaistyle.EmerMez.MainActivity$6.onClick(MainActivity.java:176)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at android.view.View.performClick(View.java:4162)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at android.view.View$PerformClick.run(View.java:17082)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at android.os.Handler.handleCallback(Handler.java:615)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at android.os.Handler.dispatchMessage(Handler.java:92)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at android.os.Looper.loop(Looper.java:137)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at android.app.ActivityThread.main(ActivityThread.java:4867)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at java.lang.reflect.Method.invokeNative(Native Method)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at java.lang.reflect.Method.invoke(Method.java:511)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
  06-06 10:35:34.092: E/AndroidRuntime(6196):     at dalvik.system.NativeStart.main(Native Method)
  06-06 10:35:34.092: I/ADM(1710): 8:   825995695: [INFO] hw_handler_u8500:961 ste_adm_hw_handler_u8500: Found matching HW-settings: devices = ('REF_Speaker_Playback_Music', '', '', '', '', ''), d2dlogical-connections = ('', '', '', '').
  06-06 10:35:34.162: I/ADM(1710): 7:   826061094: [INFO] dev:429 Device Speaker is OUTPUT
  06-06 10:35:34.162: I/ADM(1710): 9:   826061186: [INFO] dev_omx:1276 Enter dev_omx_setup_graph - device=Speaker, samplerate=44100, format=2, alloc_buffers=0, is_vc=0, bufsz=0
  06-06 10:35:34.162: E/android.os.Debug(2035): !@Dumpstate &gt; dumpstate -k -t -z -d -o /data/log/dumpstate_app_error
  </code></pre>