Error in show subtitle


#1

Hi, my ‘Show Subtitle’ action menu item isn’t working. Whenever i do click it, the app closes down and a list of errors appear.

The error is UnknownFormatConversionException: Conversion = ‘1’

The line to which the error is pointing(it’s underlined in red)-

The second line in the error log refers to the call to updateSubtitle() in the onOptionsItemSelected(MenuItem) function.

In the strings.xml file, the string ‘subtitle_format’ is defined as ‘%l$s crimes’ with the letter ‘l’ and not the number ‘1’. I’m confused, is this the error? Should instead of the letter it be the number? What is the error?

The app is working fine and opens up and does everything but as i click the ‘Show Subtitle’ menu option, the app crashes.

Any help will be appreciated. Thank you.


#2

@oosinoots

change the string name in strings.xml like below. (change “s” to “d” which refers to the integer). This worked for me.

<string name="subtitle_format">%1$d crimes</string>

#3

I am having a similar issue, the app crashes every time I click on “Show Subtitle”, however no error. The fix above does not help