title: How to use the method of an Activity in a DialogFragment?
body: <p>I'm new to C# programming and Android development.
  I'm trying to build an app and am in need of assistance. This is my dialog fragment class and I wish to use a method which is in another <code>Activity</code>(Member_Activity),(its named country_set)</p>
  
  <pre><code>public class Search_Dialog: DialogFragment
  {
      private EditText mName,mFathersName;
  
      private Member_Activity activity;
      private Button mSearchButton;
      private ArrayAdapter mCountryListAdapter;
      private AutoCompleteTextView mCountry;
      private List&lt;string&gt; mList;
  
  
      public event EventHandler&lt;SearchEventArgs&gt; searchDialogFilled;
      public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
      {
          var view=inflater.Inflate (Resource.Layout.Dialog_Search, container, false);
          activity = new Member_Activity ();
          mName = view.FindViewById&lt;EditText&gt; (Resource.Id.Name);
          mFathersName = view.FindViewById&lt;EditText&gt; (Resource.Id.FathersName);
          mCountry = view.FindViewById&lt;AutoCompleteTextView&gt; (Resource.Id.Country);
          mSearchButton = view.FindViewById&lt;Button&gt; (Resource.Id.SearchBtn);
  
          return view;
  
      }
  
      void MSearchButton_Click (object sender, EventArgs e)
      {
          searchDialogFilled.Invoke (this, new SearchEventArgs (mName.Text, mFathersName.Text, "", "", "", "", "", "", "",""));
          this.Dismiss();
      }
      public override void OnActivityCreated (Bundle savedInstanceState)
      {
          Dialog.Window.RequestFeature (WindowFeatures.NoTitle);
  
          base.OnActivityCreated (savedInstanceState);
          mList = activity.country_set ();
          mCountryListAdapter = new ArrayAdapter (this.Activity, Android.Resource.Layout.SimpleDropDownItem1Line, mList);
          mCountry.Adapter = mCountryListAdapter;
      }        
  }
  
  public class Member_Activity : Activity
  {
      public List&lt;string&gt; country_set()   
      {
          mCountryUrl = new Uri ("http://theredcatalyst.com/jain-samaj/restservice/country");
          mList = new List&lt;string&gt; ();
          mCountry = new List&lt;Country&gt; ();
          adapter = new ArrayAdapter (this, Android.Resource.Layout.SimpleSpinnerItem);
          WebClient client = new WebClient ();
          client.DownloadDataAsync (mCountryUrl);
          client.DownloadDataCompleted += (sender, e) =&gt; {
            RunOnUiThread (() =&gt; {
             string json = Encoding.UTF8.GetString (e.Result);
             mCountry = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;List&lt;Country&gt;&gt; (json);
             var mList = mCountry.Select(c=&gt;c.name).ToList();
  
            });
  
         }; 
         return mList;
      }
  }
  </code></pre>
  
  <p>please help me out. how do i go about doing this?</p>