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

addContentView within onSensorChanged genertes error

I have MyCompassView class that extends view and it draws a compass,SurfaceHolder activity that opens the camera on the surface holder and finally,MainActivity that should be overlayed by the aforementioned classes.The way I use to overlay…
user3558352
0
votes
2 answers

camera parameters can not be set

I do not know why logact generates error when i set the camera parameters regarding setSceneMode and setColorEffect as show below, and says set parameters failed but when I set the aforementioned methods to SCENE_MODE_CANDLELIGHTand EFFECT_SOLARIZE…
user3558352
0
votes
4 answers

No empty constructor error, SurfaceHolder.callback

I am trying to display the camera view using a class extends surfaceview and implements surfaceholder.callback. in my main activity ViewActivity, as shown below, i instantiate an object from the SurfaceHolderActivity and set it as a view using…
user3558352
0
votes
1 answer

Have camera view in VideoView

I have developed a basic Android application which simply displays the phone's camera view in a VideoView element. I have added camera access permission in the Manifest And the…
shallawati
  • 145
  • 1
  • 3
  • 10
0
votes
1 answer

Android Camera image distorted - SurfaceHolder -

I have a weird problem with my Camera-SurfaceHolder. I want to show the image of the camera in my activity. It all works greatly on my GalaxyS1 (CyanogenMod - Android 4.4) On my S3 (also CyanogenMod - Android 4.4) on the other hand it looks…
Tobias Reich
  • 4,952
  • 3
  • 47
  • 90
0
votes
1 answer

Nullpointer to SurfaceHolder Live Wallpaper

Hey guys I am having this error with my live wallpaper. For some reason when I try to set the surface type i get a NullPointerException error. I am not sure whats going on there. Thanks in advance. Error seems to be in the SeType() method. Here is…
0
votes
1 answer

Scale vitamio with surfaceview

I am using Vitamio media player to play RTMP stream onto a SurfaceView, everything is fine but the video size is smaller than the screen. I am looking for a way to scale the video to fit the entire screen. I set the SurfaceHolder to the fixed size…
vitasia1
  • 23
  • 1
  • 7
0
votes
0 answers

Android: How to avoid errors on unlockCanvasAndPost method?

Could anyone, please, help me to explain the following. How properly call the holder.unlockCanvasAndPost(canvas) method to avoid the errors like "Surface:unlockCanvasAndPost failed, no locked buffer"? I mean, is there any way to check that canvas…
Sergey V.
  • 981
  • 2
  • 12
  • 24
0
votes
1 answer

Which import is used for SurfaceHolder in SurfaceView.java

I copy the following code from Android's SurfaceView.java I can see that SurfaceHolder is used in the SurfaceView.java: public SurfaceHolder getHolder() { return mSurfaceHolder; } However, I can't see which one of the following imports…
user1232250
  • 329
  • 3
  • 19
0
votes
2 answers

Using the phone's camera

I m making an app which uses the camera to send data to a surfaceHolder . But when I call the addCallBack() my app crashes. Here is the code : public class Cam_View extends Activity implements SurfaceHolder.Callback{ private SurfaceView…
mremremre1
  • 1,036
  • 3
  • 16
  • 34
0
votes
1 answer

android:configChanges="orientation" with surfaceChanged

In one activity implementing SurfaceHolder.Callback, I include the line android:configChanges="keyboardHidden|orientation|screenSize" to stop the activity from being redrawn when, among other things, the screen is rotated. However, surfaceChanged()…
1''
  • 26,823
  • 32
  • 143
  • 200
0
votes
1 answer

(SurfaceHolder.Callback) surfaceCreated never called

I am developing an Android game engine using a SurfaceView to draw Bitmaps on, with a similar framework to LunarLander. My main game engine activity sets up the layout such that it should display a SurfaceView extension class, as shown…
Boston Walker
  • 534
  • 1
  • 6
  • 19
0
votes
3 answers

How to fix this SuperNotCalledException in my code?

I have a problem with my game. Everytime the player dies, a screen appears where one can press "Try Again?". However when he presses this button the game crashes and android says the game was terminated. And then suddenly the game restarts. I can't…
0
votes
1 answer

Android Camera - Half of the screen is black in Portrait mode

I was trying to create camera app, but I have faced this issue : when using camera in landscape mode everything is OK, but using in portrait with setDisplayOrientation(90) method brings up this issue: Half of the screen is black. Image here:…
user1772574
  • 68
  • 1
  • 11
0
votes
1 answer

How to draw faster? SurfaceView, SurfaceHolder dirty rect

I have a problem with SurfaceView. Function DrawWave is call by a timer Interval 5ms, BUT actually it needs more than 30ms between two calls, (I tried delete drawColor, drawPath). I tried as "Mode 1" and "Mode 2", by using Dirty rect, hope it can…
1 2 3
11
12