在Android 7下使用USB OTG端口的应用程序可以正常运行,但在Android 9上返回 <div class="chart">
<div class="gradient" style="flex: 1">
<span class="dot-black"></span>
<span class="line-black"></span>
<span class="dot-grey"></span>
</div>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
</div>
<div class="chart">
<div class="gradient" style="flex: 1">
<span class="dot-black"></span>
<span class="line-black"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
</div>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
</div>
<div class="chart">
<div class="gradient" style="flex: 2">
<span class="dot-black"></span>
<span class="line-black"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
</div>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
<span class="line-grey"></span>
<span class="dot-grey"></span>
</div>
时失败。该端口可以很好地用于通过Play商店中的应用从存储卡中读取文件。
手机是华为Mate 20 Pro(LYA-L29)Android9。
代码通常是
deviceList.size() == 0
等
如前所述,这在Android 7(三星)下正常运行。