Questions tagged [surfaceholder]

Abstract interface to someone holding a display surface. Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface. This interface is typically available through the SurfaceView class.

Abstract interface to someone holding a display surface.
Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface.
This interface is typically available through the SurfaceView class.

When using this interface from a thread other than the one running its SurfaceView, you will want to carefully read the methods lockCanvas() and Callback.surfaceCreated().

Reference page: http://developer.android.com/reference/android/view/SurfaceHolder.html

175 questions
0
votes
0 answers

Forcing layout to redraw

I made a layout with some views and I need to force redraw it, because I found that invalidate isn't redrawing instantly if I use Thread.sleep(). So, I also found that i can use SurfaceHolder to achieve this, but I don't know how to use it. If…
iulyus01
  • 37
  • 8
0
votes
0 answers

how to repaint the SurfaceView

Whenever i receive new data from bluetooth,i need to draw lines on my SurfaceView through canvas, First time i can draw successfully but from second time surfacecreated() method is never called, please help me how to repaint surfaceview.I added my…
Annie
  • 160
  • 1
  • 2
  • 15
0
votes
0 answers

Android Camera settiing contrast

I want to build an android module for capturing pictures, I want to add the possibility for adjusting contrast in real time on the preview image (without using NDK library)?
devApp
  • 11
  • 1
0
votes
1 answer

Android SurfaceView never becomes valid

SurfaceView is never available for drawing after creation. Other SO questions indicate that it can be managed with the callback functions handed to it, and it must be assigned to setContentView before the lifecycle starts. Logcat indicates that the…
Gavin
  • 2,214
  • 2
  • 18
  • 26
0
votes
0 answers

SurfaceView drawBitmap take too long, the longest time consuming 200ms

I am using Surface to show bitmap from JNI, to show a video, this is my code : SurfaceHolder holder = surfaceView.getHolder(); while(true) { if(getBitmap() == null) { continue; } …
0
votes
1 answer

MediaPlayer and SurfaceView over multiple activities

I have a media player on one activity (called player) and I want to be able to support continuous video playback from when the player is closed into a miniature view on the parent activity. I am able to do this just fine when it is audio only, the…
easycheese
  • 5,859
  • 10
  • 53
  • 87
0
votes
2 answers

How to Resolve the Android Camera setParameters failed

We are used Camera functionality in our Application. App will be published in Google App Store also. but we are facing new problem is setParameters failed in our application some devices only like moto g second generation. Please find the error…
Raj
  • 485
  • 9
  • 18
0
votes
1 answer

Android Surface view getting destroyed

I have a list view, upon clicking an item in listview it opens up a new activity. The xml of the new activity is given below:…
Krishna
  • 129
  • 1
  • 2
  • 9
0
votes
0 answers

Android Camera Without Preview

I've seen many threads on this but cannot figure out what is the best possible way of doing camera capture without having a preview. The way that I am doing it now is that I create a SurfaceTexture like this: SurfaceTexture fakePreview = new…
RobGries
  • 49
  • 1
  • 9
0
votes
1 answer

Extending android surface view for camera to support all devices

I have created a CameraSurfaceView class which provides logic for implementing the camera preview. Everything works fine on the devices I have tried. Nexus 5, Nexus 5X, Nexus 6P and even a Samsung Galaxy S5. But for some reason on the Samsung Galaxy…
0
votes
1 answer

How to take picture and video of media player and save to storage

I am streaming video from an IP camera onto my android app using rtsp protocol. There is a SurfaceView in the layout. A SurfaceHolder was created which then gets the holder from the SurfaceView then this is viewed using a MediaPlayer object. My…
Manny265
  • 1,709
  • 4
  • 23
  • 42
0
votes
1 answer

How start SurfaceHolder.Callback() event if Button Clicked?

i tried to start SurfaceCallback of Camera if Button Clicked, but i cannot , if i did Camera.setPreviewCallback() does not invoked although it works in i invoked SurfaceHolder.Callback() from onCreat()method as shown in code below public class…
Error
  • 820
  • 1
  • 11
  • 34
0
votes
1 answer

Custom Camera preview picture

I am making a custom camera that simply takes a picture and previews the image. I am not able to preview the image. Even if i call the stopPreview method after taking the picture, the picture is displayed but the camera gets reset when I press home…
android_eng
  • 1,370
  • 3
  • 17
  • 40
0
votes
1 answer

How to send a Surface object (or some representation of it) over a network

I have a Surface object in Android containing screen data. From what I understand, it is sort of a handle onto a frame/pixel buffer. How can I send this object (or some representation of it) over a network to, say, a web server?
SasukeIsCool
  • 227
  • 4
  • 11
0
votes
0 answers

MediaPlayer doesn't resume video after activity restart

I have a MediaPlayer object that uses a SurfaceHolder object as a surface. There is a button on top of the video that takes me out of the video to a website. When that happens, I pause the player with player.pause(). When I return from the website,…
Vas
  • 2,014
  • 3
  • 22
  • 38