question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NumberFormatException in RingtonePreferenceDialogFragmentCompat

See original GitHub issue

Hello, I’m getting this exception on a Pixel 3.

java.lang.NumberFormatException: 
 at java.lang.Long.parseLong (Long.java:594)
 at java.lang.Long.parseLong (Long.java:636)
 at android.content.ContentUris.parseId (ContentUris.java:89)
 at android.media.RingtoneManager.getRingtonePosition (RingtoneManager.java:513)
 at com.takisoft.preferencex.RingtonePreferenceDialogFragmentCompat.a (RingtonePreferenceDialogFragmentCompat.java:146)
 at com.takisoft.preferencex.RingtonePreferenceDialogFragmentCompat.a (RingtonePreferenceDialogFragmentCompat.java:11)
 at androidx.preference.PreferenceDialogFragmentCompat.a (PreferenceDialogFragmentCompat.java:50)
 at com.takisoft.preferencex.RingtonePreferenceDialogFragmentCompat.access$000 (RingtonePreferenceDialogFragmentCompat.java)
 or                     .access$002 (RingtonePreferenceDialogFragmentCompat.java)
 or                     .access$202 (RingtonePreferenceDialogFragmentCompat.java)
 or                     .access$600 (RingtonePreferenceDialogFragmentCompat.java)
 or                     .access$700 (RingtonePreferenceDialogFragmentCompat.java)
 or                     .addCustomExternalRingtone (RingtonePreferenceDialogFragmentCompat.java)
 or                     .buildAdapter (RingtonePreferenceDialogFragmentCompat.java)
 or                     .buildUniqueFile (RingtonePreferenceDialogFragmentCompat.java)
 or                     .createCursor (RingtonePreferenceDialogFragmentCompat.java)
 or                     .getFileDisplayNameFromUri (RingtonePreferenceDialogFragmentCompat.java)
 or                     .getUniqueExternalFile (RingtonePreferenceDialogFragmentCompat.java)
 or                     .newInstance (RingtonePreferenceDialogFragmentCompat.java)
 or                     .onCreateDialog (RingtonePreferenceDialogFragmentCompat.java)
 or                     .onDialogClosed (RingtonePreferenceDialogFragmentCompat.java)
 or                     .onPrepareDialogBuilder (RingtonePreferenceDialogFragmentCompat.java)
 or                     .splitFileName (RingtonePreferenceDialogFragmentCompat.java)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Gericopcommented, Oct 24, 2019

Do those devices run Android 10 as well?

0reactions
adrcotfascommented, Apr 22, 2020

@Gericop do you know where the list of added custom notification sounds is stored? I would like to clear it in the following case:

  • user adds custom notification sounds (on a pre-Android 10 device)
  • user updates to Android 10
  • user tries to change the notification sound, it fails with NumberFormatException. I would like to catch this and clear the custom sounds.

I see that if you start fresh with Android 10, a toast is shown when trying to add a custom ringtone which is still better than a completely unusable RingtonePreference like the case above.

Edit: the exception I’m getting comes from onPrepareDialogBuilder where createCursor is called.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What is a NumberFormatException and how can I fix it?
An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions. - ......
Read more >
@android.support.annotation.Nullable Example - Program Talk
... catch (NumberFormatException e) { Log.w(TAG, e); return null; } } ... View Source File : RingtonePreferenceDialogFragmentCompat.java , License : GNU ...
Read more >
如何在Java 中处理NumberFormatException, Double 的 ...
RingtonePreferenceDialogFragmentCompat throws ,. NumberFormatException 基本上是因为输入的字符串在解析成数值时格式不正确或者非法造成的。因此,为避免此异常, ...
Read more >
How to handle the NumberFormatException (unchecked) in ...
The NumberFormatException is an unchecked exception thrown by parseXXX() methods when they are unable to format (convert) a string into a ...
Read more >
ERROR java.lang.NumberFormatException: For input string
What is wrong? Here is the log: PWC1406: Servlet.service() for servlet Faces Servlet threw exception java.lang.NumberFormatException: For input ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found