1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-21 18:53:29 +00:00

attachments page with upload/delete

This commit is contained in:
Kyle Spearrin
2017-07-22 15:38:08 -04:00
parent b32603b472
commit f9d336a3a6
24 changed files with 786 additions and 80 deletions

View File

@@ -4,6 +4,7 @@ using Android.Content;
using Java.Security;
using System.IO;
using Android.Nfc;
using Android.Provider;
namespace Bit.Android
{
@@ -101,5 +102,28 @@ namespace Bit.Android
return message;
}
public static string GetFileName(Context context, global::Android.Net.Uri uri)
{
string name = null;
string[] projection = { MediaStore.MediaColumns.DisplayName };
var metaCursor = context.ContentResolver.Query(uri, projection, null, null, null);
if(metaCursor != null)
{
try
{
if(metaCursor.MoveToFirst())
{
name = metaCursor.GetString(0);
}
}
finally
{
metaCursor.Close();
}
}
return name;
}
}
}