it worked registering a callback for the surface !! thanks

On 6 nov, 16:47, "Hamilton Lima (athanazio)" <hamilton.l...@gmail.com>
wrote:
> thanks Mark will give a try !
>
> On 6 nov, 15:34, Mark Murphy <mmur...@commonsware.com> wrote:
>
> > Hamilton Lima (athanazio) wrote:
> > > Still with the issue ... :(
>
> > > tried to create a new project
> > > with the following code
>
> > <snip>
>
> > >    public void onCreate(Bundle savedInstanceState) {
> > >            super.onCreate(savedInstanceState);
> > >            setContentView(R.layout.main);
>
> > >            try {
> > >                    camera=Camera.open();
> > >                    SurfaceView original = (SurfaceView) 
> > > findViewById(R.id.original);
> > >                    Log.i("camera", original.toString() );
> > >                    Log.i("camera", original.getHolder().toString() );
>
> > >                    camera.setPreviewDisplay(original.getHolder());
> > >                    camera.startPreview();
>
> > The SurfaceView will not be ready by this time. You need to register a
> > callback with the SurfaceHolder and wait for the surface to be ready.
>
> > Here is a sample application demonstrating the technique:
>
> >http://github.com/commonsguy/cw-advandroid/tree/master/Camera/Picture/
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > _Beginning Android_ from Apress Now Available!

-- 
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