小编Rui*_*sma的帖子

将字符串从Activity传递到DialogFragment

在我的活动中我有这个:

public class MainActivity:Activity {RelativeLayout mRelativeLayout; 按钮mButton; 私人按钮mBtnSignUp;

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);

        mRelativeLayout = FindViewById<RelativeLayout>(Resource.Id.mainView);
        mButton = FindViewById<Button>(Resource.Id.btnLogin);

        mButton.Click += mButton_Click;
        mRelativeLayout.Click += mRelativeLayout_Click;

        mBtnSignUp = FindViewById<Button> (Resource.Id.button1);
        mBtnSignUp.Click += (object sender, EventArgs e) => 
        {
                //Pull up dialog
                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                dialog_SignUp signUpDialog = new dialog_SignUp();
                signUpDialog.Show(transaction, "dialog fragment");

                signUpDialog.mOnSignUpComplete += signUpDialog_mOnSignUpComplete;
        };
        void signUpDialog_mOnSignUpComplete (object sender, OnSignUpEventArgs e)
        {

            Thread thread = new Thread …
Run Code Online (Sandbox Code Playgroud)

c# android android-dialogfragment xamarin

2
推荐指数
1
解决办法
1388
查看次数

标签 统计

android ×1

android-dialogfragment ×1

c# ×1

xamarin ×1