java - Eclipse error: cannot be resolved to a type -
With the help of a friend, I have created a simple app for the school, which is the iframe
In. After this, I need to learn how to add a share button so that users can tell their friends about their app. I have received this code and tried to get it in my files, but it gives me some errors I have searched a lot for the solution and I think there are many possibilities to solve it, such as the project Refreshing, though I am very new, I just worry that I will mess up my project in some way, so I think it's best to ask first :) :) P>
This is the code I added:
@ Override public boolean on crat option menu (menu menu) {getMenuInflater (). Floor (R. menu. Action_bar_share_menu, menu); Menu item = menu.finditum (rd menu_item_share); ShareActionProvider myShareActionProvider = (ShareActionProvider) item.getActionProvider (); MyIntent = new intent (); MyIntent.setAction (Intent.ACTION_SEND); MyIntent.putExtra (Intent.EXTRA_TEXT, "Whatever message you want to share"); MyIntent.setType ("text / plain"); MyShareActionProvider.setShareIntent (myIntent); Back true; }
and there are errors:
- The menu can not be sorted in a way
- MenuItem is a type of Can not be resolved
- ShareActionProvider can not be sorted in a way
- ShareActionProvider can not be solved by one type (yes, twice the same error) < / Li>
Hope someone can help. Thanks all
Is your import
statement valid? Try:
- Clean and reconstruct the project
- Android SDK selected correctly
Comments
Post a Comment