Some errors on Android [closed]

4

I'm trying to start programming on Android. I created the project and came up with this code:

@Override
protected void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tela_1);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) 
{
    getMenuInflater().inflate(R.menu.main1, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) 
{
    int id = item.getItemId();
    if (id == R.id.action_settings) 
    {
        return true;
    }
    return super.onOptionsItemSelected(item);
}

But with these errors:

How to solve ??

    
asked by anonymous 29.08.2015 / 18:13

2 answers

0

See that the ActionBarActivity Inheritance is deprecated because when you create an android project it already tries to set up the appcompatv7 lib in your project sometimes to ide buga. Check if your project has been imported to appcompatv7 and then give a Clean in the project.

If it was not imported automatically do this

   Eclipse -> Import -> Existing Android Code into workspace.

Look for the SDK folder

   sdk/extras/android/support/v7/appcompat to your Eclipse workspace.

After import add the library to your project

   Select Android -> Library -> Add.

Clean the project and try again

    
18.09.2015 / 20:59
0

The answer from @Jose Vieira Neto is also valid, but I believe the problem is in some XML layout or even strings, dimensions or something similar. This should be causing an error in generating the R.java file which is the swap file between the application's resources and the source code.

    
19.10.2015 / 13:07