默認情況下,我通過使用以下代碼將可見性設置爲false。如何通過Click事件以編程方式顯示/隱藏操作欄項目
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_items, menu);
menu.findItem(R.id.action_share).setVisible(false);
return true;
}
現在,當用戶單擊我的活動中的某個按鈕時,如何再次使其可見。
謝謝。工作 – Ramesh