xamarin.android

defStyleRes has no effect in custom View (RelativeLayout)

本秂侑毒 提交于 2019-12-24 01:03:54
问题 The following constructor call attempts to style my custom RelativeLayout2 using the defStyleRes parameter but it has no effect. I ported this sample project to AndroidStudio and it worked ok. public RelativeLayout2(Context context, IAttributeSet attributeSet) : base(context, attributeSet, 0, Resource.Style.RelativeLayout2) { } styles.xml <resources> <style name="RelativeLayout2"> <item name="android:layout_width">40dp</item> <item name="android:layout_height">300dp</item> <item name="android

How to connect to SignalR server, from Xamarin client?

最后都变了- 提交于 2019-12-24 01:02:01
问题 (**) I created an ASP.NET web server, hosting SignalR hub. I followed this tutorial. It works. Then I created a Xamarin.Android client(*). The problem is I can't connected to the server. I think, I can't connected because of "localhost" in my host address. The exception is pretty big. If my suspicions are correct, how can I work around? How can I make localhost looks like normal server? (*) - I also tried with Xamarin.Forms in general. (**) - Please, look at the "EDIT" at the bottom of the

PushyNetworkException thrown on Pushy.Register

廉价感情. 提交于 2019-12-24 00:38:01
问题 I am trying to get pushy from pushy.me to work with Xamarin. I have created a Bindings Library for Pushy and it builds fine. On Pushy.Register(context) I get an exception thrown. I can't figure out what is causing the exception has anyone else tried to implement this into xamarin and were successful or have any ideas what could be going wrong. The eception is thrown on JNIEnv.GetString(JNIEnv.CallStaticObjectMethod(class_ref,id_register_Landroid_content_Context_, __args),JniHandleOwnership

MvvmCross Android - Alternative to RelativeSource binding for button command

♀尐吖头ヾ 提交于 2019-12-24 00:37:40
问题 I have a list of items bound to a MvxBindableListView with a MvxItemTemplate. I usually have 4 items in my list bound to my view. Data gets updated and the view displays the new data just fine . Now, I want to add two buttons to this item template. However, relative source binding is not available with MvvmCross. (see image) But I'm having difficulties working out a solution to this. I have tried the ItemClick binding of the list item, but that only gives me 1 possibility of click and I need

How do I bind multiple properties in an Android layout element

こ雲淡風輕ζ 提交于 2019-12-24 00:14:35
问题 I'm using MvvmCross to databind my ViewModel to an Android View layout. From the SimpleBinding example I can see that to bind a value to a property I do this: <EditText android:hint="Subtotal" android:gravity="left" android:inputType="numberDecimal" android:maxLines="1" android:numeric="decimal" local:MvxBind="{'Text':{'Path':'SubTotal','Converter':'Float'}}" /> so Text is bound to the SubTotal property of the ViewModel. But how do I bind to more than one property? In my case I want to bind a

Multidex Xamarin Maps android issues

丶灬走出姿态 提交于 2019-12-23 23:50:28
问题 After adding the Xamarin maps nuget package to my app, I was getting the Java.exe has exited with code 2 error. I enabled multi-dex in the android options and I am now getting the following error: Expecting class path separator ';' before '\Android\android-sdk\build-tools\26.0.0-preview\lib\shrinkedAndroid.jar' I re-installed the Android SDK and made sure that I had the latest version, however I am still getting the error. I've spent a good while googling this issue and trying different

Xamarin Android - Update UI control of one activity from another activity

吃可爱长大的小学妹 提交于 2019-12-23 23:41:03
问题 I have one Fragment "AddNewIncomeFragment " with a TextView("@+id/lblAccountHead"). On click on textview it starts a new activity "AccountHeadListActivit" which shows a list of existing Account Head. On selection of account head from "AccountHeadListActivity" i want to update "lblAccountHead" of first activity with selected account name, other values need to be intact. Earlier i did it using "messaging center" for xamarin form. Now i trying to do the same in xamarin native(android). ****

access assets from monodroid class library

瘦欲@ 提交于 2019-12-23 22:36:41
问题 Is it possible to access files (with build action "AndroidAsset") from a monodroid class library in a monodroid application that references the class library ? I have created an "Assets" folder in the class lib and added a text file with build action "AndroidAsset", but from the app I could not access it via Assets.Open("file.txt"); I was hoping that the Assets from the class lib and the main application could somehow be "merged"... 回答1: No - you a can't access the assets from a class lib -

How to achieve Expandablelistview child custom layout?

两盒软妹~` 提交于 2019-12-23 22:23:57
问题 I can't figure out how to achieve this in android. I have a layout like this: I want it such that on click of the plus button it will display the full layout like this: This layout is the child of an expandablelistview item. So when the expandablelistview item is clicked it shows a short lost of items in that category. Then, if the user wants to see all, he will click the plus button. Any help will be appreciated. 回答1: Create an XML layout with the name expandable_list_layout

Error deploying Xamarin to Android

末鹿安然 提交于 2019-12-23 22:17:03
问题 I am getting started with Xamarin and am trying to run the example project. I've managed to install the Android SDK and have created a virtual device to test with. However, when I try to run the project, I get a non-descriptive error that indicates that I should check the log file. When I do, I find the following two stack traces: System.InvalidOperationException at Xamarin.VisualStudio.Android.AndroidVirtualDeviceProvider.StartEmulator(IAndroidVirtualDevice virtualDevice, IProgressReport