我的问题是无法解析getReferenceFromUrl().
示例代码:
StorageReference mStorageRef; String storageurl = "http:sample" mStorageRef = FirebaseStorage.getInstance().getReference(); StorageReference ref2 = mStorageRef.getReferenceFromUrl(storageurl); ref2.delete().addOnSuccessListener(new OnSuccessListener<VoID>() { @OverrIDe public voID onSuccess(VoID aVoID) { // file deleted successfully Toast.makeText(getContext(),"file deleted",Toast.LENGTH_SHORT).show(); Log.d(TAG,"onSuccess: deleted file"); } }).addOnFailureListener(new OnFailureListener() { @OverrIDe public voID onFailure(@NonNull Exception exception) { // Uh-oh,an error occurred! Log.d(TAG,"onFailure: dID not delete file"); } });
任何帮助,将不胜感激.
解决方法 试试这个我试过这个和它的工作String storageUrl = "Chat-Images/1498804025000.png"; StorageReference storageReference = FirebaseStorage.getInstance().getReference().child(storageUrl); storageReference.delete().addOnSuccessListener(new OnSuccessListener<VoID>() { @OverrIDe public voID onSuccess(VoID aVoID) { // file deleted successfully Log.d(TAG,"onSuccess: deleted file"); } }).addOnFailureListener(new OnFailureListener() { @OverrIDe public voID onFailure(@NonNull Exception exception) { // Uh-oh,an error occurred! Log.d(TAG,"onFailure: dID not delete file"); } });总结
以上是内存溢出为你收集整理的android – 使用URL从Firebase存储中删除文件全部内容,希望文章能够帮你解决android – 使用URL从Firebase存储中删除文件所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)