To add three dot menu on project like given image below write some code in add source directly block.

1. add add source directly block and write this code.

}

2. After that add another add source directly block and write code given below.

@Override
public boolean onCreateOptionsMenu (Menu menu){
menu.add(0, 0, 0, "Item 1");
menu.add(0, 1, 1, "Item 2");
menu.add(0, 2, 2, "Item 3");
return true;
}

Here i have added three menu item. you can add more and also rename it.

3. Now write some code for for performe any action. add another add source directly block and write code given below.

@Override
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()){
case 0:
showMessage("Item 1 Clicked");
break;
case 1:
showMessage("Item 2 Clicked");
break;
case 2:
showMessage("Item 3 Clicked");
break;
}
return super.onOptionsItemSelected(item);

Now run your project. if you have any questions leave in the comment section.