mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-22 09:12:17 -05:00
Bugfix: OI really not required anymore for open dialog
This commit is contained in:
parent
fd60316448
commit
7e0a4c9d20
@ -44,12 +44,16 @@ namespace keepass2android
|
||||
* @return True if an Intent with the specified action can be sent and
|
||||
* responded to, false otherwise.
|
||||
*/
|
||||
public static bool isIntentAvailable(Context context, String action) {
|
||||
public static bool isIntentAvailable(Context context, String action, String type) {
|
||||
PackageManager packageManager = context.PackageManager;
|
||||
Intent intent = new Intent(action);
|
||||
if (type != null)
|
||||
intent.SetType(type);
|
||||
IList<ResolveInfo> list =
|
||||
packageManager.QueryIntentActivities(intent,
|
||||
PackageInfoFlags.MatchDefaultOnly);
|
||||
foreach (ResolveInfo i in list)
|
||||
Android.Util.Log.Debug("DEBUG", i.ActivityInfo.ApplicationInfo.PackageName);
|
||||
return list.Count > 0;
|
||||
}
|
||||
}
|
||||
|
@ -90,14 +90,14 @@ namespace keepass2android
|
||||
|
||||
public static void showBrowseDialog(string filename, Activity act, int requestCodeBrowse, bool forSaving)
|
||||
{
|
||||
if ((!forSaving) && (Interaction.isIntentAvailable(act, Intent.ActionGetContent))) {
|
||||
if ((!forSaving) && (Interaction.isIntentAvailable(act, Intent.ActionGetContent, "file/*"))) {
|
||||
Intent i = new Intent(Intent.ActionGetContent);
|
||||
i.SetType("file/*");
|
||||
|
||||
act.StartActivityForResult(i, requestCodeBrowse);
|
||||
return;
|
||||
}
|
||||
if (Interaction.isIntentAvailable(act, Intents.FILE_BROWSE))
|
||||
if (Interaction.isIntentAvailable(act, Intents.FILE_BROWSE, null))
|
||||
{
|
||||
Intent i = new Intent(Intents.FILE_BROWSE);
|
||||
if (filename != null)
|
||||
|
Loading…
Reference in New Issue
Block a user