2 回答
TA贡献2065条经验 获得超14个赞
Xamarin的文档指出 Android.App.Activity.OnActivityResult 的签名是
[Android.Runtime.Register("onActivityResult", "(IILandroid/content/Intent;)V", "GetOnActivityResult_IILandroid_content_Intent_Handler")]
protected virtual Void OnActivityResult (Int32 requestCode, [Android.Runtime.GeneratedEnum] Result resultCode, Intent data)
所以你必须重写它来接收活动结果,比如
protected override Void OnActivityResult (Int32 requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
// do your stuff
}
TA贡献1827条经验 获得超8个赞
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
//just holds the string
holder = data.GetStringExtra("roll_name");
//adds it to an observable collection
rolls.Add(holder);
//me trying to get something back
Log.Info(rolls.Count.ToString(), "Roll Added");
Log.Info(holder, "Please?");
}
我在这里没有看到@Override注释。您确定要覆盖Activity基类方法onActivityResult吗?
- 2 回答
- 0 关注
- 169 浏览
添加回答
举报