2

我正在创建相机应用程序,我想记录有关相机状态的信息。现在我正在使用:

Log.i("AF state", String.valueOf(result.get(CaptureResult.CONTROL_AF_STATE)));

它返回如下值:

I/AF state: 1

很难阅读,我很好奇是否有办法记录这些数字所代表的字段名称,例如:

I/AF state: CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED
4

1 回答 1

0

You can use getName()

Log.i("AF state", result.get(CaptureResult.CONTROL_AF_STATE).getName());

from Android Developer Docs

Return a camelCase, period separated name formatted like:

"root.section[.subsections].name".
于 2020-04-10T15:54:05.563 回答