예제 #1
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     SetContentView(Resource.Layout.Configuration);
     FindViewById<Button>(Resource.Id.btnConfigTest).Click += HandleTestClick;
     FindViewById<Button>(Resource.Id.btnConfigCancel).Click += HandleCancelClick;
     FindViewById<Button>(Resource.Id.btnConfigOk).Click += HandleOkClick;
     FindViewById<TextView>(Resource.Id.txtConfigUrl).TextChanged += HandleTextChanged;
     FindViewById<TextView>(Resource.Id.txtConfigUser).TextChanged += HandleTextChanged;
     FindViewById<TextView>(Resource.Id.txtPasswordConfig).TextChanged += HandleTextChanged;
     _successMessage = GetString(Resource.String.connectedToAmpache);
     _connection = new AmpacheService.Connection(this);
     BindService(new Intent(this.ApplicationContext, typeof(AmpacheService)), _connection, Bind.AutoCreate);
 }
예제 #2
0
 protected override void OnDestroy()
 {
     base.OnDestroy ();
     Console.WriteLine ("Activity Destroyed");
     ImageButton btn = FindViewById<ImageButton>(Resource.Id.imgPlayingNext);
     if(btn != null)
     {
         btn.Click -= HandleNextClick;
     }
     btn = FindViewById<ImageButton>(Resource.Id.imgPlayingPrevious);
     if(btn != null)
     {
         btn.Click -= HandlePreviousClick;
     }
     btn = FindViewById<ImageButton>(Resource.Id.imgPlayingPlayPause);
     if(btn != null)
     {
         btn.Click -= HandlePlayClick;
     }
     btn = FindViewById<ImageButton>(Resource.Id.imgPlayingShuffle);
     if(btn != null)
     {
         btn.Click -= HandleShuffleClick;
     }
     if (_currentAlbumArt != null)
     {
         _currentAlbumArt.Recycle ();
         _currentAlbumArt.Dispose ();
         _currentAlbumArt = null;
     }
     UnbindService(_connection);
     _connection.Dispose();
     _connection = null;
 }
예제 #3
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate (savedInstanceState);
     _connection = new AmpacheService.Connection(this);
     StartService(new Intent(this.ApplicationContext, typeof(AmpacheService)));
 }
예제 #4
0
 protected override void OnDestroy()
 {
     base.OnDestroy ();
     FindViewById<Button>(Resource.Id.btnConfigTest).Click -= HandleTestClick;
     FindViewById<Button>(Resource.Id.btnConfigCancel).Click -= HandleCancelClick;
     FindViewById<Button>(Resource.Id.btnConfigOk).Click -= HandleOkClick;
     FindViewById<TextView>(Resource.Id.txtConfigUrl).TextChanged -= HandleTextChanged;
     FindViewById<TextView>(Resource.Id.txtConfigUser).TextChanged -= HandleTextChanged;
     FindViewById<TextView>(Resource.Id.txtPasswordConfig).TextChanged -= HandleTextChanged;
     UnbindService(_connection);
     _connection.Dispose();
     _connection = null;
 }