1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-13 06:43:17 +00:00

attachments page

This commit is contained in:
Kyle Spearrin
2019-05-10 23:43:35 -04:00
parent 34fd9b5842
commit 29b37219c2
16 changed files with 536 additions and 90 deletions

View File

@@ -0,0 +1,30 @@
using Android.Content;
using Android.Provider;
namespace Bit.Droid.Utilities
{
public static class AndroidHelpers
{
public static string GetFileName(Context context, 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;
}
}
}