Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.res.Resources;

public class Main {
    static String getOptionalStringResource(Resources resources, int stringResourceId, String defaultString) {
        try {
            return resources.getString(stringResourceId);
        } catch (Resources.NotFoundException e) {
            return defaultString;
        }
    }
}