I would like to learn the Android Activity private method by doing it in the main action public static void main (String [] args) that I created.
I am using Eclipse ADT , and my naive approach to starting Activity as a Java application resulted in:
Fatal error detected in Java Runtime Environment:
Internal error (classFileParser.cpp: 3174), pid = 2936, tid = 2980
Error: ShouldNotReachHere ()
So, I looked at Run Configuration and found out that Android 3.1 is the only entry in the Classpath Downloads section . I was able to configure the project build path so that the JRE is in Bootstrap Notes . Then I deleted the Android 3.1 entry and added android.jar to the User Entries .
Run Configuration results in a RuntimeException:
Exception in thread "main" java.lang.RuntimeException: Stub!
in android.content.Context. (Context.java:4)
An alternative execution of some tests would be to run the JUnit test . But in the case of the private method, this is cumbersome.
Is there a way to successfully run the main method of the Android Activity class?
source
share