Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ListView myList;
- List < string>Contacts = new List< string>();
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
- SetContentView(Resource.Layout.Control);
- myList = FindViewById<ListView>(Resource.Id.clientsList);
- myList.ItemLongClick += MyList_ItemLongClick;
- }
- public void insertContact(string ContactInfo)
- {
- list =FindViewById<ListView>(Resource.Id.contactssList);
- contacts.Add(clientInfo);
- ArrayAdapter<string> myArray = new ArrayAdapter<string>(Application.Context, Android.Resource.Layout.SimpleListItem1, contacts);
- list.Adapter = null;
- list.Adapter = myArray;
- myList.DeferNotifyDataSetChanged();
- }
- public void startAsync(){
- Contacts con = new Contacts();
- Thread thread = new Thread(()=> con.Start());
- thread.Start();
- }
- MainAct main = new MainAct();
- main.insertContact("new Contact");
- public ListView getListView()
- {
- ListView myList = FindViewById<ListView>(Resource.Id.contactssList);
- return myList;
- }
- main.insertClient("what", main.getListView());
- main.RunOnUIThread(()=> main.insertClient("what", main.getListView()));
Add Comment
Please, Sign In to add comment