本文整理汇总了Java中org.appcelerator.titanium.util.TiRHelper.getApplicationResource方法的典型用法代码示例。如果您正苦于以下问题:Java TiRHelper.getApplicationResource方法的具体用法?Java TiRHelper.getApplicationResource怎么用?Java TiRHelper.getApplicationResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.appcelerator.titanium.util.TiRHelper
的用法示例。
在下文中一共展示了TiRHelper.getApplicationResource方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResource
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
private int getResource(String type, String name) {
int icon = 0;
if (name != null) {
/* Remove extension from icon */
int index = name.lastIndexOf(".");
if (index > 0) {
name = name.substring(0, index);
}
try {
icon = TiRHelper.getApplicationResource(type + "." + name);
} catch (TiRHelper.ResourceNotFoundException ex) {
Log.e(LCAT, type + "." + name + " not found; make sure it's in platform/android/res/" + type);
}
}
return icon;
}
示例2: getResource
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
private int getResource(String type, String name) {
int icon = 0;
if (name != null) {
int index = name.lastIndexOf(".");
if (index > 0) name = name.substring(0, index);
try {
icon = TiRHelper.getApplicationResource(type + "." + name);
} catch (TiRHelper.ResourceNotFoundException ex) {
Log.e(LCAT, type + "." + name + " not found; make sure it's in platform/android/res/" + type);
}
}
return icon;
}
示例3: getString
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getString(String str) {
try {
return TiRHelper.getApplicationResource("string." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例4: getLayout
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getLayout(String str) {
try {
return TiRHelper.getApplicationResource("layout." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例5: getId
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getId(String str) {
try {
return TiRHelper.getApplicationResource("id." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例6: getDrawable
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getDrawable(String str) {
try {
return TiRHelper.getApplicationResource("drawable." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例7: getColor
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getColor(String str) {
try {
return TiRHelper.getApplicationResource("color." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例8: getRaw
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getRaw(String str) {
try {
return TiRHelper.getApplicationResource("raw." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}
示例9: getXML
import org.appcelerator.titanium.util.TiRHelper; //导入方法依赖的package包/类
public static int getXML(String str) {
try {
return TiRHelper.getApplicationResource("xml." + str);
} catch (ResourceNotFoundException e) {
e.printStackTrace();
return 0;
}
}