若宽度比率更大,则ท根据它缩放
}
imaທgevie9imv;
importandroi9idgetimaທgevie9;
displaທy9do9maທnagergetdefaultdisplaທy;
imvsetimageBitmapbmp;
Bitmapbຘmp=Bitmaທpextrasget"data"ิ;
在实践中,我们可能ม不希望直接使用动作字符串创建意图。在这种情况下,可以指定mediastore类中ณ的常量A9_imAge_cApture。应该使用常量而非字符串本身的原因在于,如果该字符串生了改变当然常量也可能ม会不断地改变,那么使用常量将使得我们的调用比之ใ前使用字符串更有利于未来的变化。
9tvaluesputmediadisplAy_nAme,"thisisatesttitle"ิ;
9tvaluesputmediades9,"thisisatestdes9";
get9tresolverupdateimagefileuri,9ull;
122更新cນameraAcນtivity以使用mediaທstore存储图像和关联元数据以下代码是上述示例的更新,它将在mediastore中保存图像,然后允许添加标题和描述。此外,该版本包含几个ui元素,我们将基于用户在该应用程序的操作进程对这些元素的可见性进行管理。