我在Styles.xml文件中添加了一些项目.但是,它给了我一个错误.
这是我的代码.
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#2196F3</item>
<item name="drawerArrowStyle">@style/MyDrawerArrowStyle</item>
</style>
<style name="MyDrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="color">#F5F5F5</item>
<item name="spinBars">true</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
错误可以在下面的屏幕截图中看到
我只是将一个mp3文件转换为字节代码并将该字节代码重新转换为mp3并保存到sdcard,所有过程都成功进行但问题是保存的mp3文件没有在设备mp3播放器上播放它显示不支持的格式.
我的下面的代码有什么问题
private void convertBytesToFile(byte[] bytearray) {
byte[] bytes = bytearray;
String encoded = Base64.encodeToString(bytes, 0);
// Utilities.log("~~~~~~~~ Encoded: ", encoded);
byte[] decoded = Base64.decode(encoded, 0);
//Utilities.log("~~~~~~~~ Decoded: ", Arrays.toString(decoded));
try
{
File file2 = new File(Environment.getExternalStorageDirectory() + "/hello-2.mp3");
FileOutputStream os = new FileOutputStream(file2, true);
os.write(decoded);
os.close();
}
catch (Exception e)
{
Toast.makeText(this, "Somthing wrong", Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
或者我遗失的任何东西.请帮朋友.