Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- di
- Excel
- 구글
- MSSQL
- Generic
- SQL
- It
- jQuery
- JavaScript
- asp.net mvc
- 디자인패턴
- IT관련
- cookie
- 제네릭
- angularJS
- ADO.NET
- iframe
- XML
- 동적dom
- mvc
- 클래스
- IT 관련
- ASP.NET
- csv
- 메소드
- delegate
- c#
- LINQ
- Today
- 444
- Total
- 1,439,385
심재운 블로그
xamarin android 의 notification 을 구현하기 본문
xamarin android 의 notification 을 구현하기 위해서는 Notification.Build 객체를 사용해야 합니다.
using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; namespace ExampleNotification { [Activity(Label = "ExampleNotification", MainLauncher = true, Icon = "@drawable/icon")] public class MainActivity : Activity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById<Button>(Resource.Id.MyButton); button.Click += delegate { Notification.Builder builder = new Notification.Builder(this) // title of notification .SetContentTitle("Developers Notification") //text of notification .SetContentText("Hello,This is my first notification") //icone of notification .SetSmallIcon(Resource.Drawable.Icon); //Build the notifications Notification notification = builder.Build(); //Get the notification manager NotificationManager notificationManager = GetSystemService(Context.NotificationService) as NotificationManager; //publish the notification const int notificationId = 0; notificationManager.Notify(notificationId, notification); }; } } }
'모바일관련 > Xamarin' 카테고리의 다른 글
xamarin ios 의 데이터 txt 파일에 저장하기 (0) | 2016.12.16 |
---|---|
xamarin ios 의 OpenUrl 로 google 브라우저 창 띄우기 (0) | 2016.12.16 |
xamarin android 의 notification 을 구현하기 (0) | 2016.11.29 |
XAMARIN 자마린 ZXing.Net.Mobile 의 QRCODE BARCODE 읽기 쓰기 (0) | 2016.11.28 |
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat 오류 발생 (0) | 2016.11.23 |
Xamarin.Android.Support.Compat 24.2.1 패키지를 설치할 수 없습니다. 해결방법 (0) | 2016.11.22 |
0 Comments