我正在使用不支持armv6
架构的库。如果检测到armv6
体系结构,我想向用户显示toast。我怎么能这样做?
答案 0 :(得分:3)
检查此课程:http://developer.android.com/reference/java/lang/System.html
方法:
public static String getProperty (String propertyName)
如果您正在寻找os.arch
属性。
Log.i("mytag", "os.arch: " + System.getProperty("os.arch"));
答案 1 :(得分:1)
这应该有效:
if (System.getProperty("os.arch").equals("armv6")) {
Toast.makeText(getApplicationContext(), "Using armv6!!!", Toast.LENGTH_SHORT).show();
}
答案 2 :(得分:0)
这很简单。
if (System.getProperty("os.arch").equals("armv6")) {
Toast.makeText(this, "armv6", Toast.LENGTH_LONG).show();
}