:
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace MyStory
{
[Activity(Label = "MyStory", MainLauncher = true, Icon = "@drawable/Books")]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button btn_Short = FindViewById<Button>(Resource.Id.btn_Short);
Button btn_Flash = FindViewById<Button>(Resource.Id.btn_Flash);
Button btn_Poet = FindViewById<Button>(Resource.Id.btn_Poet);
Button btn_About = FindViewById<Button>(Resource.Id.btn_About);
btn_About.SetOnClickListener(new View.OnclickListener())
{
@override
public void onClick(View v)
{
startActivity(new Intent(MainActivity.this, About.class));
}
}
}
}
}
これは次のように画面が見えるものですoncreate:
public void myCustomClick(object o, EventArgs e) {
//handle click here
}
ただし、構文を確認してください。
あなたはそれをあなたの方法をしたい場合は、あなたの活動は、このようなView.IOnClickListener
を実装して行う必要があります
public class MainActivity: Activity, View.IOnClickListener
{
//code here
}
どうもありがとうございました、あなたがスターです! – NBS