我无法在2个活动之间共享数据:
活性1
homeButton.Click += delegate {
var second = new Intent(this, typeof(SecondPage));
second.PutExtra("reg", "qwe");
StartActivity (typeof(SecondPage));
}
Acitvity2(SecondPage)
string txt = Intent.GetStringExtra ("reg") ?? "null";
Console.WriteLine (txt);
仍然无效,有什么建议吗?
答案 0 :(得分:3)
首先,您应该传递您创建的意图:
homeButton.Click += delegate {
var second = new Intent(this, typeof(SecondPage));
second.PutExtra("reg", "qwe");
StartActivity (second);
}