xamarin.android

FragmentManager crashes when using Replace

五迷三道 提交于 2019-12-23 21:46:01
问题 I have an Activity and few Fragments. I have to replace fragment in FrameLayout. But when I'm using this function my app crashes. Here is the code of function Android.Support.V4.App.Fragment fragment = null; switch (position) { case 0: fragment = new ScheduleFragment(); break; case 1: fragment = new MainFragment(); break; } if (fragment != null) { Android.Support.V4.App.FragmentManager fragmentManager = SupportFragmentManager; var transaction = fragmentManager.BeginTransaction(); transaction

I need to block the paste function in a datepicker on XamarinForms

試著忘記壹切 提交于 2019-12-23 20:30:01
问题 In the solution that I'm building, I have a date-picker that works fine. But, if the user press the touch and paste something, it will overwrite the date. When the user pastes, the events of OnElementChanged , OnElementPropertyChanged and even the INotifyPropertyChanged are not raised. I also can't find a option to block the paste function. (When the date is choose normally, the events are being called.) This happens in iOS and Android. Can someone help me? I am stuck and my researches don't

Unable to find application Mono.Android.Platform.ApiLevel_24 or Xamarin.Android.Platform

…衆ロ難τιáo~ 提交于 2019-12-23 20:25:34
问题 I get that exception in my Xamarin.Forms Android App (all latest SDK) on a Samsung Galaxy mobile phone on app launch. 2-15 01:49:56.431 29826 29826 D AndroidRuntime: Shutting down VM 02-15 01:49:56.431 29826 29826 E AndroidRuntime: FATAL EXCEPTION: main 02-15 01:49:56.431 29826 29826 E AndroidRuntime: Process: com.rolsped.stage.TruckerApp, PID: 29826 02-15 01:49:56.431 29826 29826 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang

How to use PreferenceFragmentCompat in the preference header

大城市里の小女人 提交于 2019-12-23 19:04:21
问题 I'm trying to learn ways to build preference pages in the Xamarin Android application. I found a lot of examples with PreferenceFragment but it was marked as deprecated and it is difficult for me to rewrite them on the current stage. I've created activity to represent headers. I added IntentFilter so I can access this activity from apps list in the settings menu. Also it has internal class to group some preferences together: namespace droid.examples.Preferences { [Activity(Label = "Settings

Mono for Android, reading and writing to XLSX

為{幸葍}努か 提交于 2019-12-23 18:53:26
问题 I am developing an app using Mono for Android. I need capabilities to read and create XLSX (Excel) files. I have tried with EPPlus and NPOI, and had a quick look at Microsoft's Open XML SDK and found the following problems: EPPlus requires the WindowsBase assembly which, AFAIK, i can't use this assembly in Mono NPOI requires System.Drawing, which doesn't seem to work in Mono Open XML SDK requires the WindowsBase assembly. So i am running out of ideas, is there any library that i can run under

Single View Layout Files: Does Compiler Autowrap with Layout/ViewGroup?

感情迁移 提交于 2019-12-23 18:48:19
问题 If I have a layout file that simply contains a single TextView , I have no problems inflating it from within an activity . However, if I try to inflate a similar layout file that instead contains a single custom view, then I get a inflation exception . The only way I can get a custom view to inflate in this case is to wrap it in within Layout/ViewGroup (ie, LinearLayout ). Therefore, I was wondering if the compiler will auto-wrap a built-in view in a Layout/ViewGroup (ie, LinearLayout) if it

Saving a byte array as jpg file in android device folder

强颜欢笑 提交于 2019-12-23 18:46:03
问题 I am trying to save an image in a folder of the Android device. The code I am using is as follows var newFolder = AndroidEnvironment.GetExternalStoragePublicDirectory(AndroidEnvironment.DirectoryPictures).AbsolutePath + "/NewFolder"; Directory.CreateDirectory(cameraFolder); byte[] reducedImage = ResizeImageAndroid(imageData, 50, 50, 70); Image image = new Image {Source = ImageSource.FromStream(() => new MemoryStream(reducedImage))}; I want to save reduced image as jpg file in " newFolder ". I

System.IO.FileNotFoundException: Could not load assembly System.Web in Mono for Android

风格不统一 提交于 2019-12-23 18:45:58
问题 I'm building an android app with Xamarin that uses SkyDrive .Net API Client but I'm getting the following error when trying to run my android app on the emulator Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'System.Web.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve (Mono

Xamarin sample application not displaying anything

放肆的年华 提交于 2019-12-23 17:40:28
问题 I meant to try out Xamarin.Android for a project of mine, so I installed Visual Studio 2015 and Xamarin.Android. I then installed the packages for the versions of Android I meant to use. Now, I am trying to fire up TaskyAndroid, following this tutorial. At first, one of the two projects was skipped, which I fixed by babbling around the net. Now, if I start it in Debug, it launches the emulator and gives me this error: Couldn't connect to logcat, GetProcessId returned: 0 I checked in the

Is there a way to use ProGuard with MonoDroid?

两盒软妹~` 提交于 2019-12-23 17:27:47
问题 Our development team just (mostly) finished an Android app using MonoDroid in Visual Studio. Because it has to do with banking, we wanted to try to obfuscate it in order to add some security against anyone trying to decompile it. Initially, I figured I could just use ProGuard, but there doesn't seem to be a project.properties file that I can edit in Visual Studio. Can anyone shine some glorious helping light on this subject and tell me if it is possible to use ProGuard with Mono and my