Error accessing method in a class

0
Within src I have a package named my_utils and in this package I have the class utillog . In this class I have the

public static boolean gerouLog(Context context){
    return true;
}

When I access this method through the MainActivity class, it gives the following error:

the source attachment does not contain the source for the classloader.class android file

Code that is accessing the method in the MainActivity class:

import meus_utils.UtilLog;

public static boolean retornaGerouLog()
{
    boolean b = utillogs.gerouLog(this);

    return b;
}

omyactivity:

<activityandroid:name=".MainActivity"
        android:label="@string/app_name" >

and java -version and javac -version have the same values

    
asked by anonymous 21.07.2014 / 20:34

1 answer

1

First make sure your Activity is being configured correctly in AndroidManifest.xml. ex:

     <activity
        android:name="com.example.task.secondActivity"
        android:label="@string/app_name" />

If it does not work, check that your JDK and JRE versions are compatible with the commands:

javac -version

java - version

If it does not work, try to see your Build Path if it is pointing to the correct location of your JDK in the eclipse's own settings in the path: Project > Properties > Java Build Path > Libraries.

If none of this catches up, try to do a test by instantiating the MainActivity into another class by creating it as an intent with the code:

Intent intent = new Intent(this, secondactivity.class);
startActivity(intent);

ps: Do not forget to register in AndroidManifest.xml

And if none of the options work, here's what's going on in Logcat for a better look!

    
21.07.2014 / 21:11