'TextChanged does not fire in C# xamarin android v2019. Textchanged works in main. stops in any other method

TextChanged works as long as the program is in the main(); If I go to another method TextChanged stops working. I think it is an OS problem!!!! because the are other OS calls that do not work. like read, write, ToString(); This code works as long as I stay in the main();

     var textView_1 = FindViewById<TextView>(Resource.Id.textView1);
     var editText1 = FindViewById<EditText>(Resource.Id.editText1);
         
     editText1.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
                    {
           textView_1.Text = e.Text.ToString();
           keyboardInput = e.Text.ToString();
           if (keyboardInput != "") { scankeyinput = ""; }
           keyboardInputLength = keyboardInput.Length;
           if (keyboardInputLength > 0)
           {
           scankeyinput = keyboardInput.Substring(keyboardInput.Length - 1);
           scankeychar = scankeyinput.ToCharArray(0, 1);
           editText1.SetText(scankeychar, 0, 0);
           scankeysecond = scankeyinput;
              
           if (Searcher.search_flag == 0)
           {
             App1xamarinAndroid.Tester.StartProgram();
           }

             if (scankeyinput != null)
             {
             if (scankeyinput != "")
             {
             Getnewcharacter.scankeysecond = scankeyinput;
             Getnewcharacter.scankeySearchsecond = scankeysecond;

             Getnewcharacter.enable_search_flag = "1"                       
             Getnewcharacter.read_input_count = "T";
                    }
                    }
                    }
                    };

List item



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source