@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_invite_friend, menu); if (_inviteFriendAdapter.getSelectCount() == 0) { menu.getItem(0).setVisible(true); menu.getItem(1).setVisible(false); } else { menu.getItem(0).setVisible(false); menu.getItem(1).setVisible(true); } return true; }
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long l_position) { _inviteFriendAdapter.selection(position); TextView txtSelectCount = (TextView) findViewById(R.id.naviselectCount); txtSelectCount.setText(String.valueOf(_inviteFriendAdapter.getSelectCount())); invalidateOptionsMenu(); Toast.makeText( getApplicationContext(), "" + _phoneUserList.get(position).getHashPhone(), Toast.LENGTH_SHORT) .show(); }
private void showPopUp() { Dialog dialog = new Dialog( InviteFriendActivity.this, String.valueOf(_inviteFriendAdapter.getSelectCount())); dialog.setOnAcceptButtonClickListener( new OnClickListener() { @Override public void onClick(View v) { Toast.makeText(InviteFriendActivity.this, "Click accept button", 1).show(); } }); dialog.setOnCancelButtonClickListener( new OnClickListener() { @Override public void onClick(View v) { Toast.makeText(InviteFriendActivity.this, "Click cancel button", 1).show(); } }); dialog.show(); }