Hi Mark, when your new book on 1.5 sdk ? :-)

Mark the problem born around intent ACTION_IMAGE_CAPTURE. Mainly I
need to capture an image from camera.
I tried to use ACTION_IMAGE_CAPTURE with the follow code:

final Intent imageCaptureIntent = new Intent
(MediaStore.ACTION_IMAGE_CAPTURE);
        imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
                        Uri.fromFile(new 
File(Environment.getExternalStorageDirectory
(), "test.jpg")));
        startActivityForResult(imageCaptureIntent, RESULT_CAPTURE_IMAGE);

it work but the image resolution is too low and seem impossible get an
image with full resolution.
Then I found an other solution (the current). I created an activity
with implemented the
Runnable interface. Run func. check if new images are created from
camera app. I'd like kill the camera activty from my run func. when an
new image is found. Look below my code.

    private void CaptureImage()
    {
        _bEndThread = false;
        _thread = new Thread(this);
        _thread.start();

        ComponentName toLaunch;
        toLaunch = new ComponentName
("com.android.camera","com.android.camera.Camera");
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_LAUNCHER);
        intent.setComponent(toLaunch);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
        startActivity(intent);
    }


public void run() {
                Cursor c = managedQuery
(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,null,null,null,null);
                int iNPics = c.getCount();
                while(!_bEndThread){
                        try{
                                c = managedQuery
(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,null,null,null,Media.DATE_TAKEN
+ " ASC");
                                if( c.getCount()>iNPics ) {
                                        c.moveToLast();
                                        iNPics = c.getCount();

                                        Uri ur = Media.EXTERNAL_CONTENT_URI;
                        _uri=Uri.withAppendedPath(ur, c.getString
(c.getColumnIndex(Media._ID)));

                        /********************************************/
                        /* AND NOW ????? I WANT RESUME MY ACTIVITY */
                        /********************************************/

                        _bEndThread=true;
                                }
                                _thread.sleep(1000);
                        }
                        catch (Exception ex){
                        }
                }
        }


On 30 Mag, 13:50, Mark Murphy <mmur...@commonsware.com> wrote:
> fala70 wrote:
> > I've an activity with a Runnable thread into. From a button command I
> > call the camera external application. Into my thread there is a check
> > for news picture file is created.
>
> > Now I need to resume my activity from my run func. I tried to recall
> > startActivity of my own but doesn't work. The other solution can be
> > kill the current process (camera app).
>
> > somebody has a solution ?
>
> Wait for the user to press the back button.
>
> Remember: while you were the one to launch the camera application, it's
> not your phone, so the user is welcome to stay in the camera application
> as long as she wants.
>
> Only launch external applications when you are willing to give up control.
>
> In the case of the camera, if you don't want to give up control, use the
> Camera object and take the picture yourself.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Need Android talent? Ask on HADO!http://wiki.andmob.org/hado
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to