Autore Topic: strano problema  (Letto 668 volte)

Offline pegaso993

  • Utente junior
  • **
  • Post: 84
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    note 2
  • Sistema operativo:
    android
strano problema
« il: 28 Settembre 2013, 17:53:03 CEST »
0

la mia app su emulatore va alla grande mentre su cellulare da questi errori nel log

09-28 17:46:11.075: E/SpannableStringBuilder(949): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-28 17:46:11.075: E/SpannableStringBuilder(949): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-28 17:46:11.515: W/dalvikvm(949): threadid=13: thread exiting with uncaught exception (group=0x410712a0)
09-28 17:46:11.520: E/AndroidRuntime(949): FATAL EXCEPTION: AsyncTask #2
09-28 17:46:11.520: E/AndroidRuntime(949): java.lang.RuntimeException: An error occured while executing doInBackground()
09-28 17:46:11.520: E/AndroidRuntime(949):    at android.os.AsyncTask$3.done(AsyncTask.java:299)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
09-28 17:46:11.520: E/AndroidRuntime(949):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.lang.Thread.run(Thread.java:856)
09-28 17:46:11.520: E/AndroidRuntime(949): Caused by: java.lang.NumberFormatException: Invalid double: "3,63"
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.lang.StringToReal.invalidReal(StringToReal.java:63)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.lang.StringToReal.parseDouble(StringToReal.java:269)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.lang.Double.parseDouble(Double.java:295)
09-28 17:46:11.520: E/AndroidRuntime(949):    at com.the.restaurant.YourOrder.getDataFromDatabase(YourOrder.java:326)
09-28 17:46:11.520: E/AndroidRuntime(949):    at com.the.restaurant.YourOrder$getDataTask.doInBackground(YourOrder.java:283)
09-28 17:46:11.520: E/AndroidRuntime(949):    at com.the.restaurant.YourOrder$getDataTask.doInBackground(YourOrder.java:1)
09-28 17:46:11.520: E/AndroidRuntime(949):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
09-28 17:46:11.520: E/AndroidRuntime(949):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
09-28 17:46:11.520: E/AndroidRuntime(949):    ... 5 more
09-28 17:46:16.835: I/Choreographer(949): Skipped 300 frames!  The application may be doing too much work on its main thread.
09-28 17:46:16.960: E/SpannableStringBuilder(949): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
09-28 17:46:16.960: E/SpannableStringBuilder(949): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

Offline vincenzoc

  • Utente junior
  • **
  • Post: 148
  • Respect: +47
    • Google+
    • cerminarav
    • Mostra profilo
    • Mie applicazioni sul Play Store
  • Dispositivo Android:
    Nexus 5
  • Play Store ID:
    Vincenzo Cerminara
  • Sistema operativo:
    Arch Linux
Re:strano problema
« Risposta #1 il: 28 Settembre 2013, 18:00:34 CEST »
+2
Non riesce a convertire la Stringa "3,63" in un Double. È colpa della ",". Usa il punto "3.63".

Se vuoi usare la virgola puoi fare riferimento a NumberFormat (vedi, ad esempio, qui)
Ringrazia chi ti aiuta sul forum con l'apposito pulsante :P
Scarica Yazzy

Offline pegaso993

  • Utente junior
  • **
  • Post: 84
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    note 2
  • Sistema operativo:
    android
Re:strano problema
« Risposta #2 il: 28 Settembre 2013, 18:28:19 CEST »
0
quindi tutti sono causati da quello ?

Post unito: 28 Settembre 2013, 18:42:34 CEST
risolto apposto :D  :-o o_O 8-) O:-) :-* :-* :-* :-* :-*
« Ultima modifica: 28 Settembre 2013, 18:42:34 CEST da pegaso993, Reason: Merged DoublePost »