Java tutorial
//package com.java2s; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Point; public class Main { public static void drawArrow(Canvas canvas, int x, int y, int height, int width, Paint paint) { int triOffset = width / 2; Point a = new Point(x, y); Point b = new Point(x + triOffset, y - height); Point c = new Point(x - triOffset, y - height); drawTriangle(canvas, a, b, c, paint); } /** * Helper method to draw a generic triangle onto the canvas * @param canvas the canvas being drawn to * @param a point 1 * @param b point 2 * @param c point 3 */ public static void drawTriangle(Canvas canvas, Point a, Point b, Point c, Paint paint) { Path path = new Path(); path.setFillType(Path.FillType.EVEN_ODD); path.moveTo(b.x, b.y); path.lineTo(c.x, c.y); path.lineTo(a.x, a.y); path.close(); canvas.drawPath(path, paint); } }