Twilio APIを使用してアプリケーションを呼び出すと、サービスが確立された後ステータスTextViewテキストを変更しようとしていますが、 、私はサービスまたは放送受信機からのテキストを変更したい。 下の私のサービスコード:Xamarin Android:UI TextViewテキストをサービスまたは受信者から変更する
[Service]
class CallService : IntentService
{
public static MonkeyPhone phone ;
protected override void OnHandleIntent(Intent intent)
{
throw new NotImplementedException();
}
public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
{
// countine
new Task(() =>
{
phone = new MonkeyPhone(ApplicationContext);
View view = View.Inflate(ApplicationContext, Resource.Layout.Main, null);
TextView connectionStatus = view.FindViewById<TextView>(Resource.Id.connectionStatus);
connectionStatus.Text = "Connected ..";
}).Start();
return StartCommandResult.Sticky;
}
}
うまく機能サービスと電話が接続が十分に確立されて、ちょうど私がTextViewのテキストに
注意を変えることができる方法を知っておく必要があります:TextViewには、フラグメント
:ここ
は結果であり、そんなにうまく働いてくれてありがとう! –