The Android Uri.normaliseScheme() method always crashes.
It doesn’t even throw an exception. I have tried many different versions of the below code. What am I doing wrong?
Uri tableUri = Uri.parse("content://fake.company.app/TableName");
Log.d(TAG, "Table URI: "+tableUri);
try
{
if (tableUri != null)
{
tableUri = tableUri.normalizeScheme();
}
}
catch (Exception ex)
{
Log.e(TAG, ex.getMessage());
return false;
}
return true;
Basically I have determined that normaliseScheme is the culprit (by removing code, a line at a time). When normalizeScheme is entered my app crashes. I don’t even get any information in LogCat.
If I only keep the first 2 lines it runs fine and I get this log message:
Table URI: content://fake.company.app/TableName
The only thing that seems to succeed is to do the work myself, by using the String toLowerCase method: