Add three dot menu on Action Bar in sketchwere

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.