views:

27

answers:

1

Hi! It is the last problem I have before finishing my widget so I beg you to help me! I've created a widget wich can navigate in SMS/Inbox, and deleting them... When I delete one at the position 5 for example, this one is deleted, the other next are at the position before and the messages before the one deleted don't change of position... All seem's to bee right... but the sms at postion 5 is null and so can't be open... When I exit from the widget and relaunch it, all seem's normal, and the sms at position 5 is the old at position 6, what is expected... I use the classic method:

Uri uri=Uri.parse("content://sms/Inbox");
Cursor cursor=getContentResolver()query(uri,null,null,null,null);
cursor.moveToPosition(i);
...

But I think that there is a probleme because the sms database isn't close unless I close my widget. So can I force android to close it and reopen after, or shoold I use

TWOpenHelper openHelper = new TWOpenHelper(context);
SQLiteDatabase database = openHelper.getReadableDatabase();

in this last case I think I need the real uri of sms database (data/ data//databses) wich is?...

thank's for giving me your opinion and really hope a little help to finish it.

A: 

I've created a widget wich can navigate in SMS/Inbox, and deleting them

This violates the SDK. Your app widget will break on some Android devices. Your app widget may break in future editions of Android. Please do not do this.

CommonsWare
Ok, I understand your advertising, but the widget I have develop is waiting by people who like "sense" or "tat home" and have not those.I test my app on 1.6 to 2.1 and there is no problem. I just want that after the database is mofied to reload my widget.
Olivier69