mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
catch exception whose cause I'm not sure of but that make it
impossible to launch the app when a game gets into a certain state. Probably need to catch exceptions at a top level of game listing process and offer to discard those in which non-recoverable exceptions occur. Later...
This commit is contained in:
parent
5c00e31d95
commit
fc9c262796
1 changed files with 17 additions and 14 deletions
|
@ -265,21 +265,24 @@ public class Utils {
|
||||||
if ( s_phonesHash.containsKey( phone ) ) {
|
if ( s_phonesHash.containsKey( phone ) ) {
|
||||||
name = s_phonesHash.get( phone );
|
name = s_phonesHash.get( phone );
|
||||||
} else {
|
} else {
|
||||||
name = null;
|
try {
|
||||||
ContentResolver contentResolver = context.getContentResolver();
|
name = null;
|
||||||
Cursor cursor =
|
ContentResolver contentResolver = context.getContentResolver();
|
||||||
contentResolver
|
Cursor cursor =
|
||||||
.query( Uri.withAppendedPath( PhoneLookup.CONTENT_FILTER_URI,
|
contentResolver
|
||||||
Uri.encode( phone )),
|
.query( Uri.withAppendedPath( PhoneLookup.CONTENT_FILTER_URI,
|
||||||
new String[] { PhoneLookup.DISPLAY_NAME },
|
Uri.encode( phone )),
|
||||||
null, null, null );
|
new String[] { PhoneLookup.DISPLAY_NAME },
|
||||||
if ( cursor.moveToNext() ) {
|
null, null, null );
|
||||||
int indx = cursor.getColumnIndex( PhoneLookup.DISPLAY_NAME );
|
if ( cursor.moveToNext() ) {
|
||||||
name = cursor.getString( indx );
|
int indx = cursor.getColumnIndex( PhoneLookup.DISPLAY_NAME );
|
||||||
|
name = cursor.getString( indx );
|
||||||
|
}
|
||||||
|
cursor.close();
|
||||||
|
s_phonesHash.put( phone, name );
|
||||||
|
} catch ( Exception ex ) {
|
||||||
|
name = "not found";
|
||||||
}
|
}
|
||||||
cursor.close();
|
|
||||||
|
|
||||||
s_phonesHash.put( phone, name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( null == name && phoneStandsIn ) {
|
if ( null == name && phoneStandsIn ) {
|
||||||
|
|
Loading…
Reference in a new issue