Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Paint;

public class Main {

    public static int measureTextWidth(String text, int textsize) {
        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint.setTextSize(textsize);
        return (int) paint.measureText(text);
    }
}