Problem to open SMS after deleting another with my widget...

by Olivier » Wed, 10 Mar 2010 17:55:24 GMT


Sponsored Links
 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/<package_name>/databses) wich is?...

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




--



Other Threads

1. question about process restart management

Hackborn,

I am having the same problem as mentioned in the mail thread below
that my activity is being restarted after I am killing it through DDMS
or Android shell. My activity starts a service that just prints
"Hello" in OnCreateFunction using Log class and does nothing else.
when there are things to be done. In my case there is nothing else to
be done by the service or the actvity that starts the service, then
why is it being restarted. Please let me know if my understanding is
not correct.

Thanks,
-Anshul






--~--~---------~--~----~------------~-------~--~----~

2. incoming call broadcast intent

Will 1.0 have a broadcast intent for incoming calls?

My goal is to be simply notified of the incoming call. I'm not
interested in intercepting it.

The m5-0.9 changes overview (http://code.google.com/android/migrating/
m5-0.9/changes-overview.html#TOC-Telephony) seems to indicate that the
following classes should be used:

  MobileDataStateBroadcastReceiver
  ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
  ACTION_DATA_CONNECTION_STATE_CHANGED

but they are not on in 0.9 rc1

PhoneStateIntentReceiver is still present in 0.9 rc1 but is
deprecated.

I'm aware of PhoneStateListener and will use it as needed, but what
I'm interested in is what Google's plans are concerning a broadcast
intent in 1.0.




--~--~---------~--~----~------------~-------~--~----~

3. Probable bug in LocalActivityManager save instance state

4. Google Releases Street View Maps For Mobile

5. SqlLite!!???

6. First Google Android phone to cost $199

7. How to display data from a content provider using WebView.loadUri