4. Simple Intent Example
(웹페이지 오픈하기) - 3
MainActivity.cs
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace OpenWebpage
{
[Activity (Label = "OpenWebpage", MainLauncher = true)]
public class MainActivity : Activity {
protected override void OnCreate (Bundle bundle)
5. Simple Intent Example
(웹페이지 오픈하기) - 4
MainActivity.cs
{
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 += (sender, e) => {
//인텐트를 생성하여 웹페이지 오픈
var uri = Android.Net.Uri.Parse ("http://ojc.asia");
var intent = new Intent (Intent.ActionView, uri);
StartActivity (intent);
};
} } }