Android Can only use lower 16 bits for requestCode
目录
错误日志
java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
...
...
原因
context.startActivityForResult
的 requestCode
有对应限制
对应源码为
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (requestCode != -1 && (requestCode&0xffff0000) != 0) {
throw new IllegalArgumentException("Can only use lower 16 bits for requestCode");
}
super.startActivityForResult(intent, requestCode);
}