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:

  1. The menu can not be sorted in a way
  2. MenuItem is a type of Can not be resolved
  3. ShareActionProvider can not be sorted in a way
  4. 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:

  1. Clean and reconstruct the project
  2. Android SDK selected correctly

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -