Wednesday, 14 November 2018

Why does new ActionView for file have a black background

When I select the app to open my file, it opens with a black background (same as my app). I want it to open in it's default form, should be a white background with black text. My app uses a black background. Does that background carry through to the new Intent? The PDF Reader that receives the intent takes on the background color of the Sending App, why? How do I change that?

Android.Net.Uri uri = FileProvider.GetUriForFile(this, "myauthority", file);

            Intent target = new Intent(Intent.ActionView);
            target.SetDataAndType(uri, "application/pdf");
            target.SetFlags(ActivityFlags.ClearWhenTaskReset | ActivityFlags.NewTask | ActivityFlags.NoHistory);

            Intent intent = Intent.CreateChooser(target, "Open File");
            intent.AddFlags(ActivityFlags.GrantReadUriPermission);
            try
            {
                if (target.ResolveActivity(PackageManager) != null)
                {
                    StartActivity(intent);
                }
            }
            catch (System.Exception ex)
            {
                throw new System.Exception("Unable to open PDF, check documents folder.", ex);
            }



from Why does new ActionView for file have a black background

No comments:

Post a Comment