-
Notifications
You must be signed in to change notification settings - Fork 0
/
OverActivity.cs
49 lines (45 loc) · 1.33 KB
/
OverActivity.cs
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace HangingMan
{
[Activity(Label = "OverActivity")]
public class OverActivity : Activity
{
TextView t;
string text;
Button re;
protected override void OnCreate(Bundle savedInstanceState)
{
SetContentView(Resource.Layout.GameOver);
text = Intent.GetStringExtra("text") ?? "text not avalible";
base.OnCreate(savedInstanceState);
re = FindViewById<Button>(Resource.Id.restart);
t = FindViewById<TextView>(Resource.Id.tv);
re.Click += OnClick;
t.Click +=OnClick;
// Create your application here
}
private void T_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
}
private void OnClick(object sender, EventArgs e)
{
t.Text = text;
Button btn = (Button)sender;
if (btn == re)
{
Intent intent = new Intent(this, typeof(HomeActivity));
StartActivity(intent);
}
}
}
}