mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
fix NPE on Kindle Fire, which has no SMS DB. Duh.
This commit is contained in:
parent
83754d626e
commit
949b804f35
1 changed files with 15 additions and 13 deletions
|
@ -634,24 +634,26 @@ public class SMSService extends Service {
|
|||
ContentResolver resolver = getContentResolver();
|
||||
String[] columns = new String[] { "body","address" };
|
||||
Cursor cursor = resolver.query( uri, columns, null, null, null );
|
||||
if ( 0 < cursor.getCount() ) {
|
||||
try {
|
||||
int bodyIndex = cursor.getColumnIndexOrThrow( "body" );
|
||||
int phoneIndex = cursor.getColumnIndexOrThrow( "address" );
|
||||
while ( cursor.moveToNext() ) {
|
||||
String msg = fromPublicFmt( cursor.getString( bodyIndex ) );
|
||||
if ( null != msg ) {
|
||||
String number = cursor.getString( phoneIndex );
|
||||
if ( null != number ) {
|
||||
handleFrom( this, msg, number );
|
||||
if ( null != cursor ) {
|
||||
if ( 0 < cursor.getCount() ) {
|
||||
try {
|
||||
int bodyIndex = cursor.getColumnIndexOrThrow( "body" );
|
||||
int phoneIndex = cursor.getColumnIndexOrThrow( "address" );
|
||||
while ( cursor.moveToNext() ) {
|
||||
String msg = fromPublicFmt( cursor.getString( bodyIndex ) );
|
||||
if ( null != msg ) {
|
||||
String number = cursor.getString( phoneIndex );
|
||||
if ( null != number ) {
|
||||
handleFrom( this, msg, number );
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch ( Exception ee ) {
|
||||
DbgUtils.loge( ee );
|
||||
}
|
||||
} catch ( Exception ee ) {
|
||||
DbgUtils.loge( ee );
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
private void sendResult( MultiEvent event, Object ... args )
|
||||
|
|
Loading…
Reference in a new issue