xamarin.android

Menu Resource Item Position Title to Left of Icon

爱⌒轻易说出口 提交于 2020-01-05 14:24:53
问题 Is there a way to position the title text for a menu item to the left of the icon rather than to the right in an ActionBar? So in: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/forward" android:title="Begin" android:icon="@drawable/ForwardArrow" android:showAsAction="always"></item> </menu> It would appear "Begin ->" instead of "-> Begin" 回答1: While you can define things like android:actionButtonStyle in a theme and apply that to your activity, I am

How to make EditText's parent clickable?

£可爱£侵袭症+ 提交于 2020-01-05 12:57:09
问题 Suppose I have this pink box: It consists of LinearLayout with its children: TextView as field name and an EditText . EditText is intentionally disabled. What I want is that, user can click wherever user wants on that pink box. By the way, please just ignore any UI/UX things that you found weird. I've tried, but user can't tap the area that EditText occupies. User have to tap in TextView or blank area on pink box so that the apps got the 'click'. But if user taps on EditText 's area, nothing

Xamarin.Forms FCM OnRefereshToken Method not called in release mode Android Device

这一生的挚爱 提交于 2020-01-05 09:29:26
问题 I have Implemented a Xamarin Pushnotification using FCM and my code looks like // This service handles the device's registration with FCM. [Service] [IntentFilter(new[] { "com.google.firebase.INSTANCE_ID_EVENT" })] public class ZCFirebaseIIDService : FirebaseInstanceIdService { #region override methods public override void OnTokenRefresh() { var refreshedToken = FirebaseInstanceId.Instance.Token; App.DeviceToken = FirebaseInstanceId.Instance.Token; } #endregion } Also I have added all

SelectedItem of Spinner always null

久未见 提交于 2020-01-05 08:49:09
问题 I created custom array adapter for my spinner control but when clicking an item from the list it's not selected. Here my code: public class CustomArrayAdapter : BaseAdapter { readonly LayoutInflater inflater; List<string> items; public CustomArrayAdapter(Context context, List<string> items) { this.inflater = LayoutInflater.FromContext(context); this.items = items; } public override int Count { get { return items.Count; } } public override Object GetItem(int position) { return null; } public

xamarin Visual Studio 2015 apk fails to install: Error “parsing the package”

耗尽温柔 提交于 2020-01-05 08:03:27
问题 Wrote app for an android device whose installed Android version is Lollipop 5.1 (AZPEN A1040 tablet - latest version available for it). The app installs and works correctly in the emulator (setup to emulate a Lollipop 5.1 device) However, after archiving without any issues, when attempting to install the app's apk file to the actual target device, I get the following error: "There was a problem parsing the package" The project's properties in Visual Studio 2015 are displayed in the graphics

OnLongPress is not working with our touch events

你说的曾经没有我的故事 提交于 2020-01-05 06:43:08
问题 I am developing a game in which I want to perform certain operations when user single touch the screen, and some other operations when user long press the screen. For this, I have created a Gesture Detector class and add events to them. Surface View Class public MySurfaceView(Context context, IAttributeSet attrs):base(context, attrs) { this.context=context; SetWillNotDraw(false); gestureDetector = new GestureDetector(context, new GestureListener()); } public override bool OnTouchEvent

OnLongPress is not working with our touch events

青春壹個敷衍的年華 提交于 2020-01-05 06:43:03
问题 I am developing a game in which I want to perform certain operations when user single touch the screen, and some other operations when user long press the screen. For this, I have created a Gesture Detector class and add events to them. Surface View Class public MySurfaceView(Context context, IAttributeSet attrs):base(context, attrs) { this.context=context; SetWillNotDraw(false); gestureDetector = new GestureDetector(context, new GestureListener()); } public override bool OnTouchEvent

How to add Logo image inside Toolbar

陌路散爱 提交于 2020-01-05 04:41:14
问题 Hi new to Xamarin android. Have this question: 1) How to add an image Logo inside the Toolbar? What is the Image Logo size interms of W X H ? Here the toolBar <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent"> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"

How to Add an Image to Android Emulator Directly or through Visual Studio (Xamarin Project)

一曲冷凌霜 提交于 2020-01-05 04:27:07
问题 I currently am creating an Android application using Visual Studio 2015 . It requires to have an image in the AVD to test the application. How do we add image to our emulated Android device in Visual Studio ( Xamarin Project )? I have seen some questions and answers to do so in Eclipse or Android Studio ( Java -based): How to add an image to the emulator gallery in android studio? How we save image in gallery of emulator upload picture to emulator gallery But I cannot find one to do it in

Xamarin Android use SetSound for Notification Channel to play custom sound on notification

感情迁移 提交于 2020-01-05 04:21:29
问题 I have I have been wasting at least a day trying to make this work. I am trying to play an mp3 file that i placed in Resources/raw once a notification is received. I do not know exactly how to get the Uri. My questions please are: 1.To play a custom file do you have to place it in Resources/raw or can it be also in Assets/Sounds under the Xamarin Android project. 2.How do i get the Uri correctly based on where the mp3 file resides. This is my code: private void createNotificationChannel() {