无法导入在相机应用android.os.SystemProperties [英] can't import android.os.SystemProperties in Camera app

查看:2386
本文介绍了无法导入在相机应用android.os.SystemProperties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在camera.java,我需要在系统中获取属性。但是,我无法导入android.os.SystemProperties,编译相机总是抱怨:

In camera.java, I need to get property in system. However, I can't import android.os.SystemProperties, compile camera always complains:

packages/apps/Camera/src/com/android/camera/Camera.java:53: cannot find symbol
symbol  : class SystemProperties
location: package android.os
import android.os.SystemProperties;

在camera.java的开始,我包括:

In the beginning of camera.java, I included:

import android.os.Message;
import android.os.MessageQueue;
import android.os.SystemClock;
import android.os.SystemProperties; /* (this is in line 53)*/

这似乎SystemProperties不android.os包,但我已经检查了框架源$ C ​​$ C,它确实在里面。

It seems SystemProperties is not in android.os package, but I have checked the frameworks source code, it's indeed in it.

这在发生相机应用。我发现在包/应用程序目录许多应用程序使用SystemProperties以这种方式。这真的很奇怪。

This happen in camera app. I found many apps under packages/app dir using SystemProperties in this manner. It's really strange.

推荐答案

SystemProperties类设置好的隐藏注释。结果
所以,你想在应用层使用这个类,
你必须使用refelection。

SystemProperties class is setted 'hide' annotation.
So you want to use this class in application layer, you have to use refelection.

SystemProperties类的定义是以下

the definition of SystemProperties class is below.

package android.os;
/**
 * Gives access to the system properties store.  The system properties
 * store contains a list of string key-value pairs.
 *
 * {@hide}
 */
public class SystemProperties

这篇关于无法导入在相机应用android.os.SystemProperties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆