android error while Parse string to double
<pre><code>enter code here

 06-27 00:34:04.641: ERROR/AndroidRuntime(13633): FATAL EXCEPTION: main
06-27 00:34:04.641: ERROR/AndroidRuntime(13633): java.lang.RuntimeException: Unable to start activity ComponentInfo{yaraby.y/yaraby.y.ghost}: java.lang.NumberFormatException: 
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.ActivityThread.access$2300(ActivityThread.java:126)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.os.Looper.loop(Looper.java:123)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.ActivityThread.main(ActivityThread.java:4633)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at java.lang.reflect.Method.invokeNative(Native Method)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at java.lang.reflect.Method.invoke(Method.java:521)
06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
 06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at dalvik.system.NativeStart.main(Native Method)
  06-27 00:34:04.641: ERROR/AndroidRuntime(13633): Caused by: java.lang.NumberFormatException: 
  06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at org.apache.harmony.luni.util.FloatingPointParser.parseDouble(FloatingPointParser.java:267)
 06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at java.lang.Double.parseDouble(Double.java:287)
 06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at yaraby.y.ghost.onCreate(ghost.java:89)
  06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633)
  06-27 00:34:04.641: ERROR/AndroidRuntime(13633):     ... 11 more
</code></pre>

<p>Line 89 is </p>

<pre><code>enter code here
  Double p1=    Double.parseDouble(x); 
</code></pre>

<p>what i'm receving from server is String and i want it to be double and its already a double number but recive as a string  </p>

<pre><code>enter code here
 String x=inFromServer.readLine();
         String y=inFromServer.readLine();


            x=x.trim();
   Double p1=   Double.parseDouble(x);
                    y=y.trim();
        Double p2=   Double.parseDouble(y);
</code></pre>
