Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Invoking a method from another method

$
0
0

There are two button methods as below:

private void Start_Clicked(object sender, EventArgs e)
{
try
{
_speechRecongnitionInstance.StartSpeechToText();
}
catch (Exception ex)
{
input.Text = ex.Message;
}
if (Device.RuntimePlatform == Device.iOS)
{
start.IsEnabled = false;
}
}

private void Submit_Clicked(object Sender, EventArgs args)
{
var input_text = input.Text;
webapicall(input_text).Wait();
output.Text = output_text;
CrossTextToSpeech.Current.Speak(output_text);
LogTable ld = new LogTable
{
Username = username,
Question = input_text,
Answer = output_text,
Timestamp = DateTime.Now.ToString()
};
int i = App.Database.SaveItem(ld);
}

How to I call second method from first method?
I tried but I am facing problem, without executing first method, second method is invoked.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>