Suggested Answer:C🗳️
Both an icon and text can be displayed. The <item> element supports several attributes you can use to define an item's appearance and behavior. The items in the above menu include the following attributes: android:id A resource ID that's unique to the item, which allows the application to recognize the item when the user selects it. android:icon A reference to a drawable to use as the item's icon. android:title A reference to a string to use as the item's title. Incorrect: B: Adding Menu Items Based on an Intent Sometimes you'll want a menu item to launch an activity using an Intent (whether it's an activity in your application or another application). When you know the intent you want to use and have a specific menu item that should initiate the intent, you can execute the intent with startActivity() during the appropriate on-item- selected callback method (such as the onOptionsItemSelected() callback). However, if you are not certain that the user's device contains an application that handles the intent, then adding a menu item that invokes it can result in a non- functioning menu item, because the intent might not resolve to an activity. To solve this, Android lets you dynamically add menu items to your menu when Android finds activities on the device that handle your intent. References: http://developer.android.com/guide/topics/ui/menus.html
B. MenuItem can decide the Intent issued when clicking menu components.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Mmadi
2 years, 3 months ago