xamarin.android

Xamarin MediaPlugin and different Android version

蹲街弑〆低调 提交于 2019-12-24 18:18:27
问题 I have a problem with Media Plugin. If the compilation target is Android 6.0 it works fine in debug mode in my device that is V. 5.0.1. The problem is that when I compile in Release mode I receive this error: > Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could not resolve reference to 'Android.Views.KeyboardShortcutGroup' (defined in assembly 'Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') with scope 'Mono.Android,

Is there way to change language while app running

元气小坏坏 提交于 2019-12-24 18:13:09
问题 everyone. :) I have App with a multi-layout and I'm trying to change the language while running the app. I find this code to help me change the language using Android.Content; using Android.OS; using Java.Util; namespace RuntimeAppLanguage { internal class LanguageManager { private const string MYLANGUAGE = "myLanguage"; private const string MYPREF = "myPreference"; public static Context LoadLanguage(Context context) { var loadedLanguage = GetLanguage(context, Locale.Default.Language); return

RecyclerView Adapter - NotifyItemRemoved - Removed item appears again after scroll

北慕城南 提交于 2019-12-24 17:13:24
问题 I think I am doing it all wrong, but I have a RecyclerView Adapter and simple button click (in this case a LinearLayout ) which triggers the following this.NotifyItemRemoved(position); The full button code is the following public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { .......... LinearLayout _ARC = V.FindViewById<LinearLayout>(Resource.Id.moreArc); _ARC.Click += async delegate { try { Log.Info("101029", "ARC_Clicked"); await usersAct.SWITCH

Capture selected RadioButton from the RadioGroup

我怕爱的太早我们不能终老 提交于 2019-12-24 16:40:53
问题 I have radiobutton group , which has two radiobuttons as follows. I could able to see both of them. I have used the same approach from the following sample code https://github.com/MvvmCross/MvvmCross-Tutorials/blob/master/ApiExamples/ApiExamples.Core/ViewModels/ViewModels.cs When I debug the code in order to see which radio button is selected, I put a debug point in the SelectedItem but when I change radio button it does hit neither set or get in the SelectedItem . How do I capture which

Can not use System.drawing.common in Mono.Android and Xamarin.ios

旧巷老猫 提交于 2019-12-24 16:07:26
问题 I am using System.drawing.common in my project, and it worked fine in .net core. Now I am trying to use System.drawing.common in Mono.Android project and Xamarin.ios project. Some problem occured: 1, I create a Mono.Android lib project, and install System.drawing.common with NuGet. It seems to be successful, but after installing, I can not find System.drawing.common in the "reference" list. I tryed to use "System.Drawing.Bitmap", but can not find Bitmap class. 2, I checked the package folder,

How to convert Java Syntax to C# of Myclass obj=new Myclass(){ public override mymethod() }

醉酒当歌 提交于 2019-12-24 15:53:37
问题 I want to convert Java code to C# but facing problem to do so public class MyService extends Service { static final String CONNECTIVITY_CHANGE_ACTION = "android.net.conn.CONNECTIVITY_CHANGE"; NotificationManager manager ; @Nullable @Override public IBinder onBind(Intent intent) { return null; } @Override public int onStartCommand(Intent intent, int flags, int startId) { // Let it continue running until it is stopped. Toast.makeText(this, "Service Started", Toast.LENGTH_LONG).show();

MvvmCross vnext: monodroid binding Dictionary Key similar to wp7

瘦欲@ 提交于 2019-12-24 15:50:33
问题 When I change MainMenuViewModel in Tutorial.Core to use a Dictionary like this: `public Dictionary Items { get; set; } public ICommand ShowItemCommand { get { return new MvxRelayCommand>((type) => DoShowItem(type.Value)); } } public void DoShowItem(Type itemType) { this.RequestNavigate(itemType); } public MainMenuViewModel() { Items = new Dictionary<string, Type>() { {"SimpleTextProperty", typeof(Lessons.SimpleTextPropertyViewModel)}, {"PullToRefresh", typeof(Lessons.PullToRefreshViewModel)},

MonoCross: KeyNotFoundException in MXDialogActivityView.OnCreate() when re-starting application

风流意气都作罢 提交于 2019-12-24 15:27:35
问题 I've been using Xamarin's Mono for Android and the MonoCross framework to develop an application, which is currently running under Android (2.3, 4.0 and others). In my app, I have a main activity, from where the user can start new activities, which again start other activities and so on. (e.g. Main -> A -> B -> C) From time to time, I get following problem: When the application is paused (or stopped) for some time (i.e. not in the foreground), and/or other memory consuming apps are started,

When using Intent.ActionOpenDocumentTree can you allow the user to save in a location off the device?

邮差的信 提交于 2019-12-24 14:36:04
问题 This is a Xamarin project but I think the code mostly just wraps the android sdk. When I pick a file I use/get this: var intent = new Intent(Intent.ActionGetContent); intent.AddCategory (Intent.CategoryOpenable); StartActivityForResult (Intent.CreateChooser (intent, "Select file"), 0); Notice how it is capable of opening from remote locations. But when try to pick a directory I use/get this: // https://stackoverflow.com/questions/27889377/action-open-document-tree-only-returns-empty-recent

Offline sync in xamarin forms without azure mobile service client

眉间皱痕 提交于 2019-12-24 14:04:02
问题 I am new to Xamarin development. I am building a Xamarin application with RESTful API and using SQL server for online storage and SQLite for the Local storage. I need to add offline sync feature to my app. Is there any way to sync remote server and local DB, without using azure mobile service client? 回答1: yes you can make use of Sync Adapter this would sync your data in background but this is Platform specific and hence you had to implement it in Native Class Also If you want a Periodic Sync