xamarin获取textview值以存储在数据库中

时间:2017-09-20 12:51:57

标签: xamarin.android

我使用后台位置服务获取用户当前位置,我想获取textview值存储在数据库中,如何从textview获取值

 latText = FindViewById<TextView>(Resource.Id.lat);
        userName = FindViewById<TextView>(Resource.Id.userName);

        longText = FindViewById<TextView>(Resource.Id.longx);
        altText = FindViewById<TextView>(Resource.Id.alt);
        speedText = FindViewById<TextView>(Resource.Id.speed);
        bearText = FindViewById<TextView>(Resource.Id.bear);
        accText = FindViewById<TextView>(Resource.Id.acc);

        altText.Text = "altitude.";
        longText.Text = "longitude";
        speedText.Text = "speed";
        bearText.Text = "bearing";
        accText.Text = "accuracy";

1 个答案:

答案 0 :(得分:0)

  

我想将textview值存储在数据库中,如何从textview获取值

使用以下代码从TextView获取值:

var text = FindViewById<TextView>(Resource.Id.lat).Text;