public void OnClick(object sender, System.EventArgs e) { View v = sender as View; switch (v.Id) { case JPush.Resource.Id.init: init(); break; case JPush.Resource.Id.setting: //Intent intent = new Intent(MainActivity.this, typeof(PushSetActivity)); //startActivity(intent); break; case JPush.Resource.Id.stopPush: JPushInterface.StopPush(ApplicationContext); break; case JPush.Resource.Id.resumePush: JPushInterface.ResumePush(ApplicationContext); break; case JPush.Resource.Id.getRegistrationId: string rid = JPushInterface.GetRegistrationID(ApplicationContext); if (rid.Length > 0) { mRegId.Text = "RegId:" + rid; } else { Toast.MakeText(this, "Get registration fail, JPush init failed!", ToastLength.Short).Show(); } break; } }