xamarin.android

Portable Class Library does not support System.IO, Why?

末鹿安然 提交于 2019-12-23 07:12:39
问题 I created a portable class library to be used in my Monodroid project . But the problem is that I need System.IO library but unfortunately I couldn't add it. I even tried to add it by Add Reference option but it was in vain. Why this happened ? How shall I do this ? 回答1: You can't use System.IO because it isn't a portable class library. System.IO makes calls which are specific to the OS it runs on (Windows), while the portable class library is ment to be cross-platform. The solution to what

SlidingMenuSharp System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Android.Widget.Scroller'

风格不统一 提交于 2019-12-23 05:49:08
问题 We have a Xamarin.Android 7 app. We are getting the following exception which causes the app to crash. It says something about Android.Widget.Scroller, but we are not using this component explicitly in our app anywhere. We are using ScrollView and GridView in xaml files though. One solution which we came across was to move back to Xamarin.Android 6, but that is not a feasible solution due to app requirements. One more solution we came across was to use ListViewCachingStrategy, but couldn't

Xamarin Android - How to schedule and alarm with a BroadcastReceiver

点点圈 提交于 2019-12-23 05:30:07
问题 (I'm asking here because I didn't get help at Xamarin forums) I'm creating an alarm with this code: Intent alarmIntent = new Intent(context, typeof(AlarmReceiver)); notificationClickIntent = PendingIntent.GetActivity(context, 0, new Intent(), 0); pendingIntent = PendingIntent.GetBroadcast(context, 0, alarmIntent, PendingIntentFlags.UpdateCurrent); am = (AlarmManager)Android.App.Application.Context.GetSystemService(Context.AlarmService); DateTime setTime = new DateTime(temp.Ticks + offset); /

App crashes with java.lang.UnsatisfiedLinkError for Oreo devices with Xamarin.Android

倖福魔咒の 提交于 2019-12-23 05:14:00
问题 I'm receiving crash reports in Google Play Console for my app, and the stacktrace is as follows: java.lang.UnsatisfiedLinkError: at mono.android.Runtime.register (Native Method) at md5f3dc63ecaad575af71bd7a9b1622f75b.n.<clinit> (n.java:20) at java.lang.Class.newInstance (Native Method) at android.app.ActivityThread.handleCreateBackupAgent (ActivityThread.java:3431) at android.app.ActivityThread.-wrap3 (Unknown Source) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1813) at

Xamarin.Forms - Open an Android Intent?

依然范特西╮ 提交于 2019-12-23 04:58:15
问题 I am trying to open a PDF in Xamarin.Forms (Android) How would I translate this Java to C# in the Android project (PCL) and what namespaces are used?? Intent intentUrl = new Intent(Intent.ACTION_VIEW); intentUrl.setDataAndType(uri, "application/pdf"); intentUrl.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mActivity.startActivity(intentUrl); I've got this far, but how do I call the actiity in an injected class? Uri uri = new Uri("file:///" + PathToFile(filename)); Intent intent = new Intent

Creating retail experience app in xamarin android

帅比萌擦擦* 提交于 2019-12-23 04:42:24
问题 I am integrating retail experience app in Xamarin android. Using the procedure mentioned in following link, I am getting the expected output. but i want to do few changes in the UI of this app. So how can we achieve that? 来源: https://stackoverflow.com/questions/45209117/creating-retail-experience-app-in-xamarin-android

Error CS0115 '…OnBindViewHolder(Object, int)': no suitable method found to override

蓝咒 提交于 2019-12-23 04:38:35
问题 I'm binding this library: https://github.com/mancj/MaterialSearchBar And generally it works, however, I have an issue when I try to add the support of the RecyclerView, I added the following libraries: And I got the following errors: I tried to follow this advice of creating some partial classes: xamarin.android binding thorw 'does not implement inherited abstract member 'RecyclerView.Adapter.OnCreateViewHolder(ViewGroup, int)' But it didn't work and I started to get duplicates, personally, I

File upload popup not opening mono android xamarin

冷暖自知 提交于 2019-12-23 04:19:11
问题 I am using xamarin mono.android Version 4 with api level 19. I am trying below code for showing a website in webview my webpage has a upload file control but upload file is not working on that webpage page when opened using this app in webview. No popup appears when i click on file upload control in webview. Main Activity File Code using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; using Android.Webkit;

Schedule Alarm manager to run a method every Thursday

筅森魡賤 提交于 2019-12-23 04:15:16
问题 For example i want to have an alarm that will fire every Thursday at 12PM How would i do this? I have something implemented but isnt working properly,with the code that i have, today is wednesday 15, if change the date of the phone to 16 thrusday, the app doesnt do anything, if i change the date of the phone for the next wednesday 22 the phone sends a notification, but only should send on thursdays. Here is my code: MainActivity: protected override void OnCreate(Bundle bundle) {

Xamarin Android EggsToGo (swipe gesture) listener in view doesnt work with ListView

我只是一个虾纸丫 提交于 2019-12-23 04:05:58
问题 I have a problem with EggsToGo (swipe left/right effect) listener in a ListView control. I had problem HERE and found the problem with EggsToGo exactly with a ListView listener... when I have a listener on my ListView so the ScrollView doesnt work there.... Is there some solution how I can make EggsToGo listener on view that will work on ListView? My test project is HERE - the problem is in the FirstFragment (First view). When I have a listener on listview, the scrollview doesnt work. But