Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;

import android.graphics.drawable.Drawable;

import android.widget.TextView;

public class Main {
    @SuppressWarnings("deprecation")
    public static void setTvLeftPic(Context context, int resId, TextView tv) {
        Drawable drawable = context.getResources().getDrawable(resId);
        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
        tv.setCompoundDrawables(drawable, null, null, null);
    }
}