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

Creating GameLoop in Android

I am creating an application related to GameLoop in this application if the user clicks the screen an image is drawn on the screen and it moves on the screen with a random speed and also in the random direction.. In the code there is no errors but…
0
votes
1 answer

Android : surfaceView cannot getHolder() in onCreate(), must in onResume()

In my activity, I has some views and a surfaceView. Here is my first code in onCreate() public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); upBtn = (Button) findViewById(R.id.upBtn); // and more widget…
hqt
  • 29,632
  • 51
  • 171
  • 250
0
votes
1 answer

SurfaceView: dequeueBuffer failed on Android 4.0

I'm building a live wallpaper, it has a bitmap with fullHD resolution which is scaled down to the size of the users phone screen. It works perfectly on Android 2.2 and 2.3 but crashes on 4.0. EDIT : I narrowed the problem down a little bit using…
0
votes
2 answers

android Surface View with XML Layout and add buttons to a Canvas

so i made a Surface view with a canvas, so i could do some graphics. is there any way of having a xml layout with a canvas, so i can have buttons and what not on the screen, or is there any other option to making buttons on a canvas?
steven minkus
  • 131
  • 2
  • 2
  • 14
0
votes
1 answer

display CameraPreview and Custom Views inside a SurfaceView

I run into following Problem: I'm currently displaying a CameraPreview on a SurfaceView using its SurfaceHolder as described here Camera Dev Guide. So its mentioned that I have to set the Type of my SurfaceHolder like this; // deprecated setting,…
Rafael T
  • 15,401
  • 15
  • 83
  • 144
0
votes
1 answer

Draw text on SurfaceHolder

I am doing an application witch uses the webcam and i want to display some text after the picture is taken so in the method ShutterCallBack i wrote this ShutterCallback shutterCallback = new ShutterCallback() { public void onShutter() { …
opc0de
  • 11,557
  • 14
  • 94
  • 187
0
votes
1 answer

SurfaceView drawing failure

I am trying an example having SurfaceView. I have inherited my class from SurfaceView and using as follows: public class MySurfaceView extends SurfaceView implements SurfaceHolder.Callback { Context context; MySurfaceViewThread mThread; …
Khawar Raza
  • 15,870
  • 24
  • 70
  • 127
-1
votes
2 answers

Android Camera Orientation

I'm trying to learn an Augmented Reality basic from this article : http://www.devx.com/wireless/Article/42482/0/page/2 when it run, the camera took an opposite orientation. My question is how to get a fixed and normal view with the camera. This is…
farissyariati
  • 365
  • 4
  • 9
  • 21
-1
votes
2 answers

Cannot resolve symbol 'Callback'

I am currently creating a 2D Android game using Android Studio. I have created a class called GameView which extends SurfaceView and implements SurfaceHolder.CallBack. However, I am getting the error, "Cannot resolve symbol 'Callback'". I have…
ShreJ
  • 1
  • 1
  • 3
-2
votes
1 answer

onSurfaceChanged (SurfaceHolder holder, int format, int width, int height) VS onVisibilityChanged(boolean visible)

As I'm new to Live Wallpaper development, I was struggling to know the difference between onSurfaceChanged (SurfaceHolder holder, int format, int width, int height) VS onVisibilityChanged(boolean visible) in Live Wallpaper can any one differentiate…
vinay Maneti
  • 1,447
  • 1
  • 23
  • 31
1 2 3
11
12