Error inflating when extending a class

I’m trying to create a custom view GhostSurfaceCameraView that extends SurfaceView. Here’s my class definition file GhostSurfaceCameraView.java: public class GhostSurfaceCameraView extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder mHolder; Camera mCamera; GhostSurfaceCameraView(Context context) { super(context); // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); … Read more

How to have a transparent ImageButton: Android

<ImageButton android:id=”@+id/previous” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:src=”https://stackoverflow.com/questions/3402787/@drawable/media_skip_backward” android:background=”@drawable/transparent”></ImageButton> This is what I tried to get a transparent ImageButton so as to place those buttons on a SurfaceView. But Eclipse, gives me an error in the project as soon as I include the transparent line in xml. Please help. 22 s 22 Try using null for the background … Read more