xamarin.android

Android Scheduled Timer - Mono for Android or Java

这一生的挚爱 提交于 2019-12-11 18:34:21
问题 I need to run a method every 5 seconds using Mono for Android. Is there a scheduled timer in Android? I have tried this code, however, it fails to start: 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.Views; using Android.Widget; using Glass.Core.Interfaces; using Glass.Core; using Java.Util; namespace Glass.UI.AN { [Application(Label = "Glass", Icon = "

Retrieve image from Firebase Storage

社会主义新天地 提交于 2019-12-11 18:26:32
问题 I am trying to pull an image from Firebase storage so i can then use the URL of the image to put into an Imageview. Most of the answers i find are to do with android studio, no answers for xamarin. This is the code i have so far: storage = FirebaseStorage.Instance; storageRef = storage.GetReferenceFromUrl("gs://......com"); StorageReference ImageFolder = storageRef.Child("Images"); StorageReference UserFolder = ImageFolder.Child(auth.CurrentUser.Email); StorageReference UserImage = storageRef

Android MapFragment as custom control in MvvmCross

大兔子大兔子 提交于 2019-12-11 18:02:05
问题 I'm working on a project in which I can use MapFragment or SupportMapFragment as a custom control. I tried to mix custom control(N-18) and Fraggle(N-26) tutorial but I can't make it work. My Custom Control Class: public class CustomMapView : MvxFragment { public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var ignored = base.OnCreateView(inflater, container, savedInstanceState); return this.BindingInflate(Resource.Layout

Error: No resource found that matches the given name: attr

▼魔方 西西 提交于 2019-12-11 17:56:07
问题 I have an Xamarin.Forms app that fails to build for Android on my Mac (same on Windows) while it did work fine before (not sure what changed in the meantime). The same projects builds fine on the pc of a colleague. It's a Xamarin.Forms app using PCL. I get the following errors in my styles.xml file: Resources/values/styles.xml(3): error APT0000: Error: No resource found that matches the given name: attr 'colorAccent'. Resources/values/styles.xml(2): error APT0000: Error: No resource found

Memory Leak on ListView (due to ByteArrayToImageConverter)

房东的猫 提交于 2019-12-11 17:49:32
问题 I m using ByteArrayToImageConverter to convert byte array i m getting from SQL server databse , the converter as below public class ByteArrayToImageConverter : IValueConverter { public ImageSource retSource; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { // ImageSource retSource = null; if (value != null) { byte[] imageAsBytes = (byte[])value; // byte[] decodedByteArray = System.Convert.FromBase64String(Encoding.UTF8.GetString(imageAsBytes, 0,

Xamarin Calling a TabbedPage using a Button

半城伤御伤魂 提交于 2019-12-11 17:39:35
问题 I have a problem. I want to load a TabbedPage when I click on a button in a different page, so I created this code: protected void imgAdd_Clicked(object sender, EventArgs args) { var tabbedPage = new TabbedPage(); tabbedPage.Children.Add(new Page1()); tabbedPage.Children.Add(new Page2()); App.Current.MainPage = tabbedPage; } But the result is as follows: As you can see the Image leaves a trail of the image when you swipe between the pages. However, when I load the Tabbed Page using the App

Xamarin Android: Divide elements on groups in RecyclerView

冷暖自知 提交于 2019-12-11 17:38:54
问题 Hello everyone my name is Taniguchi. I've implemented a recyclerview and i wish to divide items on this recyclerview on groups There is a way that i can divide itens by key, but i need to create multiple axmls and viewholder, but i couldnt get how can i do that. How can i divide elements in the recyclerview items using a key to divide then ? I ve found this documentation but is on java. Divide elements on groups in RecyclerView someone has a example in C# ? my recyclerview adapter: public

Custom ViewCell Contain Button Has Command And Binding To This Command

故事扮演 提交于 2019-12-11 17:38:43
问题 I fix customize some problems in some projects one of them that I need to use custom ViewCell in Separated class and file like that: <?xml version="1.0" encoding="UTF-8"?> <ViewCell xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="HBRS.Controls.ViewCellTemplates.ArticleItemViewCell"> <Image> <Image.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.clickCommand, Source={x:Reference Name=mArt}}"

Hide/show buttons inside recyclerview

随声附和 提交于 2019-12-11 17:32:27
问题 I want to show and hide some buttons within the recycler view in recycler item clicked. For example I have a recyclerw view with two items like this On click of the 1st item, the buttons Edit and delete should be displayed. My adapter code is here: using Android.Support.V7.Widget; using Android.Views; using Android.Widget; using System; using System.Collections.Generic; namespace RecyclerViewTest { internal class BuyerAdapter : RecyclerView.Adapter { public List<Buyer> mlivestock; public

My xamarin app shows my code in release mode

我的未来我决定 提交于 2019-12-11 17:26:16
问题 I'm a beginner in Xamarin and I just create a simple android app in Xamarin by preprocessed razor template. But after debugging or after releasing and installing the app on my phone, if I tap on the screen a white page it showed, and in another phone my code were shown on the phone. What can I do to solve this problem? This is my code: <div class="row" style="padding:5px"> <nav class="navbar navbar-inverse"> <div class="container"> <div class="navbar-header"> <a href="file:///android_asset