Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

format flags conversion mismatch exception

Tags:

java

android

Hi hopefully this fulfils the criteria for being a well written question. I'm new to programming and I've been trying to write an application for climbers on android that tells the user what they should be climbing based on their current ability for a training period. The app requires the user to input their climbing ability and the length of their wall.

I've set up a preferences menu using SharedPrefences for this with a numeric edit text field and a list. Initially I had an class cast exception as I was trying to use the string from the edit text as a float/double/int (I tried all three!).

I've converted the string to a double using Double = Double.valueof(StringFromPrefernce) which solved that error but is now producing the error java.util.FormatFlagsConversionMismatchException: %o does not support ' ' which I've not been able to find a solution for.

The app allows the user to access the preference menu initially, however once they have set some values any attempt to access the preference menu will produce this force close.

SOLUTION:

In my preferences.xml I had referenced a string. That string contained a % symbol which was responsible for the force close. Removing the % symbol fixed the issue.

like image 257
Gareth Bowen Avatar asked Jul 31 '12 23:07

Gareth Bowen


1 Answers

i was getting that because i was using a tool to do automatic translations. it was putting in % s instead of %s.

like image 114
j2emanue Avatar answered Oct 06 '22 18:10

j2emanue