// 点击事件 @SuppressLint("NewApi") @Override public void onClick(View v) { switch (v.getId()) { case R.id.common_back: finish(); break; case R.id.rb_notification: isFalg = 0; page = 1; if (adapter_m.getmMessage_list() != null) adapter_m.getmMessage_list().clear(); adapter_m.notifyDataSetChanged(); mPullList.getRefreshableView().setAdapter(adapter_n); setRadioButton(); mNotification.setBackground(getResources().getDrawable(R.drawable.rd_message_l)); mNotification.setTextColor(getResources().getColor(R.color.white)); getData(); break; case R.id.rb_message: isFalg = 1; page = 1; if (adapter_n.getmMessage_list() != null) adapter_n.getmMessage_list().clear(); adapter_n.notifyDataSetChanged(); mPullList.getRefreshableView().setAdapter(adapter_m); setRadioButton(); mMessage.setBackground(getResources().getDrawable(R.drawable.rd_message_r)); mMessage.setTextColor(getResources().getColor(R.color.white)); getData(); break; default: break; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_user_message); ViewUtils.inject(this); if (adapter_m == null) { adapter_m = new UserMessageAdapter(this); adapter_n = new UserNotificationAdapter(this); mPullList.getRefreshableView().setAdapter(adapter_n); } else { adapter_m.notifyDataSetChanged(); adapter_n.notifyDataSetChanged(); } setPullRefresh(); // 初始化下拉刷新 initData(); // 初始化数据 }