xamarin.android

Imported type defined multiple times on Xamarin.Android

笑着哭i 提交于 2019-12-25 02:19:56
问题 Here are my imports: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Widget; using Android.Support.V4.View; Then var mPager = FindViewById<ViewPager> (Resource.Id.pager); This line gives me The imported type 'Android.Support.V4.View.ViewPager' is defined multiple times what is wrong in here? ps: both v4 and v13 are referenced. 回答1: You can't include V4 and V13

Xamarin Using DataContractJsonSerializer for Android Blank App

时间秒杀一切 提交于 2019-12-25 01:59:46
问题 I am trying to use DataContractJsonSerializer but I can't seem to get a reference/namespace for it. I created my app on a .NET Framework 4.5. When I click add reference I only get the version 2.0.5.0 for System.ServiceModel 回答1: If you want to get DataContractJsonSerializer working with Android you would need to create a PCL project and then it would be available under namespace System.Runtime.Serialization.Json. This would require a Xamarin business license or higher to work. Better option

How to enable switch on multi-select listview with binding in Xamarin.Forms?

别来无恙 提交于 2019-12-25 01:58:57
问题 I found this article/sample code it is how to make a to-do list. If you browse the code it is using bindings to determine if the task is done or not. What I am trying to accomplish is the same concept as the to-do list. Please visit my Github Repository for my full code: Here is my app logic: Upon loading of the application the app will show all the list of activities (e.g. Walking, climbing, rafting, etc.). The user will select 1 or more activities. The user will save the form in the local

Saving image into SQL Server with web service in Xamarin Android

我的梦境 提交于 2019-12-25 01:36:41
问题 I am developing an app with Xamarin Android, I want to select an image from the gallery and save it to a SQL Server database using a WCF service. My code is working except one part that the image want to convert and save into the database. My column datatype for the image is: varbinary(MAX) . My variable definition for the image in the project is: byte[] imageByte; Some part of my code is below: private void PicSelected() { //mSelectedPic = selectedPic; Intent = new Intent(); Intent.SetType(

Dynamically load xml control and share UI control

孤街醉人 提交于 2019-12-25 01:35:52
问题 I am new to xamarin. Is it possible to load a shared UI control in an xml file, if yes, how? I am open to better idea. Below is a static loading via include , where parent.axml statically load child.xml . <include android:id="@+id/child" layout="@layout/child" android:layout_below="@id/toolbar" android:layout_width="fill_parent" android:layout_height="wrap_content" /> parent.axml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Activity as dialog: Place in top left corner

不打扰是莪最后的温柔 提交于 2019-12-25 01:33:29
问题 I'm trying to place an Android activity that uses the Holo.Dialog theme in the top left corner of my application by using the following code in OnCreate(): var layoutParams = this.Window.Attributes; layoutParams.Gravity = GravityFlags.Top | GravityFlags.Left; (This is Mono for Android) It kind of works, however there is a tiny gap between the actual corner and the beginning of my dialog, which you can see in the following screen shot: https://www.dropbox.com/s/cyy9lglq5642nz1/device-2013-05

Xamarin OpenInputStream permission ACTION_OPEN_DOCUMEN

夙愿已清 提交于 2019-12-25 00:43:21
问题 I'm developing an app on android and i'm getting an exception when i use openInputStream with certain uri, here is my code try { using (var stream = Context.ContentResolver.OpenInputStream(Android.Net.Uri.Parse(uriString))) { // } } catch (Exception e) { } when the uri = 'content://media/external/images/media/61155' I get no exception but when the uri is like this 'content://com.android.providers.media.documents/document/image%3A61797' I get this exception Permission Denial: opening provider

CalendarView Issues when Used Directly (Outside of a DatePicker)

試著忘記壹切 提交于 2019-12-25 00:34:10
问题 I'm using a CalendarView directly, not a DatePicker , b/c its being used as a drop-down/pop-up style dialog where space is factor ( the user clicks a button located to the right of date field, and the CalendarView drops down, appearing directly below the field, aligned/anchored to the button). There are two show-stopping issues I've ran into, and spent an entire 10 hour day debugging with no resolve. Issue #1 - Weeks Missing Weeks appear to missing, and depending on the date, sometimes the

Xamairin forms : Android.Views.InflateException: <Timeout exceeded getting exception details>

爷,独闯天下 提交于 2019-12-25 00:26:31
问题 Research a lot about this issue and found the same question, which doesn't solve my problem. so starting a new question. Xamarin Android: Android.Views.InflateException - Error when loading Layout Getting Xamairin forms : Android.Views.InflateException: Timeout exceeded getting exception details when loading layout. Main.axml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height

How can I change Android MaterialCalendarView month color?

纵然是瞬间 提交于 2019-12-25 00:26:14
问题 I'm using Xamarin Android MaterialViewCalendar Month header dissappears on some devices, so I want to set it's color manually. <com.prolificinteractive.materialcalendarview.MaterialCalendarView android:id="@+id/calendarView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/white" app:mcv_showOtherDates="all" /> 回答1: How can I change Android MaterialCalendarView month color? When you use MaterialCalendarView , there are three different