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. Vimeo mobile video search?

Hi all,

Has anyone found documentation regarding how to search for mobile content on
vimeo's site? They recently added some support for non-flash mobiles, and
going to their site on an Android phone gets you content that will open the
Android native video player when clicked, but I would like to write and app
that searches this content for display in the player myself.

Thanks,
Steve

--

2. Video playback youtube, code sequence..

Hi All,
could you a little help wih  code for streaming youtub 3gp, video .


TIA



package org.shouraig.com;

import java.io.IOException;

import android.app.Activity;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.widget.MediaController;
import android.widget.VideoView;

public class Video12 extends Activity implements
SurfaceHolder.Callback,
                MediaPlayer.OnBufferingUpdateListener,
                MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener,
                MediaPlayer.OnPreparedListener {

        private static final String TAG = "Video12";
        private static final String HTTP = "http://www.youtube.com/watch?
v=6ej-imJWuno";
        VideoView Video12;


        /** Called when the activity is first created. */
        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Log.v("Video12", "***launched::" + HTTP);
        Log.d(TAG,"onCreate started");
        MediaController mc = new MediaController(this);
        mc.setAnchorView(Video12);
        Uri video = Uri.parse(HTTP);
        Video12.setMediaController(mc);
        Video12.setVideoURI(video);
        Video12.start();

        //View files from resource

        MediaPlayer mp = new MediaPlayer();

        try {
                        mp.setDataSource(HTTP);
                } catch (IllegalArgumentException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IllegalStateException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        try {
                        mp.prepare();
                } catch (IllegalStateException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        mp.start();

    }

        public void surfaceChanged(SurfaceHolder holder, int format, int
width,
                        int height) {
                // TODO Auto-generated method stub

        }

        @Override
        public void surfaceCreated(SurfaceHolder holder) {
                // TODO Auto-generated method stub

        }

        @Override
        public void surfaceDestroyed(SurfaceHolder holder) {
                // TODO Auto-generated method stub

        }

        @Override
        public void onBufferingUpdate(MediaPlayer mp, int percent) {
                // TODO Auto-generated method stub

        }

        @Override
        public void onCompletion(MediaPlayer mp) {
                // TODO Auto-generated method stub

        }

        @Override
        public boolean onError(MediaPlayer arg0, int arg1, int arg2) {
                // TODO Auto-generated method stub
                return false;
        }

        @Override
        public void onPrepared(MediaPlayer mp) {
                // TODO Auto-generated method stub

        }
}

--

3. Albums not showing saved images until after restarting device

4. How to create this UI using a minimum of custom view code

5. Custom View for arranging ImageViews

6. dig code out of apk

7. Android market developer fee - annual or forever?