Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.res.Resources;

public class Main {
    public static String resolveString(Context context, Resources res, String string) {
        if (string.startsWith("@")) {
            String subs = string.substring(1, string.length());
            String[] parts = subs.split("/");
            int id = res.getIdentifier(parts[1], parts[0], context.getPackageName());
            if (id == 0x0) {
                return string;
            }
            return res.getString(id);
        }
        return string;
    }
}