I am new in android development. I want to implement a double tap event in my wallpaper so that when I double tap the wallpaper it opens the application.
here is the code where I have drawn the wallpaper image:
public class AbcService extends WallpaperService
{
public void onCreate()
{
super.onCreate();
}
public void onDestroy()
{
super.onDestroy();
}
public Engine onCreateEngine()
{
return new wallpaperEngine();
}
class wallpaperEngine extends Engine
{
public Bitmap image1;
wallpaperEngine()
{
image1 = BitmapFactory.decodeResource(getResources(), R.drawable.img_3);
}
public void onCreate(SurfaceHolder surfaceHolder)
{
super.onCreate(surfaceHolder);
}
public void onOffsetsChanged(float xOffset, float yOffset, float xStep, float yStep, int xPixels, int yPixels)
{
drawFrame();
}
void drawFrame()
{
final SurfaceHolder holder = getSurfaceHolder();
Canvas c = null;
try
{
c = holder.lockCanvas();
if (c != null)
{
c.drawBitmap(image1, 0, 0, null);
}
} finally
{
if (c != null) holder.unlockCanvasAndPost(c);
}
}
}
what to do now?? am i on right track?
Thank You in Advance..