xamarin.android

Adapter.NotifyDataSetChanged doesn't work

橙三吉。 提交于 2019-12-12 01:48:50
问题 I have adapter for my listView and i want to update my adapter using NotifyDataSetChanged(), but it doesn't work for me. That's how I add data in my adapter: if (Messages.Count != 0) { ChatAdapter = new BubbleAdapter (this, Messages); if(listViewChat.Adapter == null) { listViewChat.Adapter = ChatAdapter; } else { ChatAdapter.NotifyDataSetChanged(); } } But like I said it does not work... If i update using this way, my listView is scrolling to top: ChatAdapter = new BubbleAdapter (this,

Transparent WebView in xamarin

最后都变了- 提交于 2019-12-12 01:45:07
问题 I searched Transparent WebView but I could not find any answer for my problem. I have these: string str = "Hello. How are you? I am fine."; String s = "<html><head><style type='text/css'>body {" + "text-align: justify;}</style></head><body dir = rtl>" +str + "</body></html>"; webview.LoadDataWithBaseURL("", s, "text/html", "utf-8", null); <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android

xamarin android player, not starting within Visual Studio 2015

妖精的绣舞 提交于 2019-12-12 01:41:36
问题 I used Xamarin Studio and swapped over to Visual Studio for creating Android apps. Although my projects load perfectly, I can't debug them, whenever I click on build it succeeds but when it comes to starting the emulator it just does nothing. This is the build log I got: ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 0 failed, 1 skipped ========== I got nothing more, no errors, no indication of doing anything. 回答1: Deploy 0

Read xml file in Android/Mono

随声附和 提交于 2019-12-12 01:29:19
问题 I'm trying to read an xml file which I plan to include as part of my mobile application. I've created a folder called "XML" and added a file called "test.xml". The files build action is set to content. When I run the app it crashes on trying to find the file. Here is the code I'm using: _path = "XML/test.xml"; doc = new XmlDocument(); doc.Load(_path); Here is the error I get: System.IO.DirectoryNotFoundException has been thrown. Could not find a part of the path "/XML/test.xml" Do I need to

Xmarin.Forms.Xaml.XamlParseException no method found

蹲街弑〆低调 提交于 2019-12-12 01:24:17
问题 Here is my code <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="App3.Page2" Title="Welcome to the second page!!!"> <ContentPage.Content> <ScrollView> <StackLayout> <Grid> <Grid.RowDefinitions> <RowDefinition Height="3*"/> <RowDefinition Height="3*"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Editor x:Name="fstN" Text="Enter 1st number" Grid.Row="0" Grid.Column="0" Grid

Best practis for handling bitmaps in android with mono droid / xamarin.android

[亡魂溺海] 提交于 2019-12-12 01:23:42
问题 I am having some memory issues with our android app when handling bitmaps (duh!). We are having multiple activities loading images from a server, this could be a background image for the activity. This background image could be the same for multiple activities, and right now each activity is loading its own background image. This means if the flow is ac1->ac2->ac3->ac4 the same image will be loaded 4 times and using 4x memory. How do I optimize imagehandling for this scenario? Do I create an

working with jar and so files in Xamarin forms

一曲冷凌霜 提交于 2019-12-12 01:22:33
问题 I'm working with Brother Label Printer "QL-710W" for printing purpose. I'm using Xamarin forms targeting Android for printing a web view content. I'm facing problem in communicating with the printer. They have provided android demo application with code which is working fine for me in Android studio. I'm trying to use provided .jar files and .so files in Xamarin Android. I'm stuck in adding and consuming .jar and dependent .so files. Can any one suggest, How to add .jar files and .so files in

OpenCV 3.0.0 Android native method not found: org.opencv.core.Mat.n_Mat:()J

ⅰ亾dé卋堺 提交于 2019-12-11 23:08:16
问题 I'm using native android Opencv 3.0.0 library for Xamarin.Android via Android Java Bindings Library . I'm doing pretty same like this Tutorial and the problem is that i got this exception Native method not found: org.opencv.core.Mat.n_Mat:()J What can i do to resolve this problem? Any help will be appreciated,thanks! My source code of Main Activity : public class MainActivity : Activity { Mat m; Mat grayM; ImageView imageView; public MainActivity() { if (!OpenCVLoader.InitDebug()) { System

Write xml to file

旧城冷巷雨未停 提交于 2019-12-11 22:49:52
问题 I know that there are many same questions here, but it doesn't solve my problem I want to write xml to file. Writing Android app on Xamarin. I already create it I create xml like this: XmlDocument doc = new XmlDocument(); XmlElement el = (XmlElement)doc.AppendChild(doc.CreateElement("Order")); el.SetAttribute("CallConfirm", "1"); el.SetAttribute("PayMethod", "Безнал"); el.SetAttribute("QtyPerson", ""); el.SetAttribute("Type", "2"); el.SetAttribute("PayStateID", "0"); el.SetAttribute("Remark",

Handle Activity Finishing Event In Xamarin.Android

淺唱寂寞╮ 提交于 2019-12-11 22:13:42
问题 Is there anything similar to FormClosingEvent in Xamarin.android? I have two activities - A and B . B is saving some data and is called from A on button click. I have list of data in A and want to automatically update it after B activity is finished. Any suggestions how to do it? 回答1: It sounds like you want to use StartActivityForResult with Activity A starting activity B in the following manner var myIntent = new Intent (this, typeof(ActivityB)); StartActivityForResult (myIntent, 0);