how to instance for example java.awt.color in sdk0.9 ??

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how to instance for example java.awt.color in sdk0.9 ??

Postby tim » Thu Aug 21, 2008 11:10 am

since google moved the java.awt package into android.jar there is now way to instance for example java.awt.color !!

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.navteq.sdk10test;
  2.  
  3.  
  4.  
  5. import java.awt.Color;
  6.  
  7. import android.app.Activity;
  8.  
  9. import android.os.Bundle;
  10.  
  11.  
  12.  
  13. public class sdk10test extends Activity {
  14.  
  15.     /** Called when the activity is first created. */
  16.  
  17.     @Override
  18.  
  19.     public void onCreate(Bundle savedInstanceState) {
  20.  
  21.         super.onCreate(savedInstanceState);
  22.  
  23.         setContentView(R.layout.main);
  24.  
  25.  
  26.  
  27.    Color cl = new Color(4);
  28.  
  29.     }
  30.  
  31. }
Parsed in 0.050 seconds, using GeSHi 1.0.8.4

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. 08-21 10:06:53.833: WARN/dalvikvm(1395): VFY: unable to resolve new-instance 18 (Ljava/awt/Color;) in Lcom/navteq/sdk10test/sdk10test;
  3.  
  4. 08-21 10:06:53.843: WARN/dalvikvm(1395): VFY:  rejecting opcode 0x22 at 0x0008
  5.  
  6. 08-21 10:06:53.843: WARN/dalvikvm(1395): VFY:  rejected Lcom/navteq/sdk10test/sdk10test;.onCreate (Landroid/os/Bundle;)V
  7.  
  8. 08-21 10:06:53.843: WARN/dalvikvm(1395): Verifier rejected class Lcom/navteq/sdk10test/sdk10test;
  9.  
  10. 08-21 10:06:53.843: WARN/dalvikvm(1395): Class init failed in newInstance call (Lcom/navteq/sdk10test/sdk10test;)
  11.  
  12. 08-21 10:06:53.843: DEBUG/AndroidRuntime(1395): Shutting down VM
  13.  
  14. 08-21 10:06:53.843: WARN/dalvikvm(1395): threadid=3: thread exiting with uncaught exception (group=0x40010e28)
  15.  
  16. 08-21 10:06:53.843: ERROR/AndroidRuntime(1395): Uncaught handler: thread main exiting due to uncaught exception
  17.  
  18. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395): java.lang.VerifyError: com.navteq.sdk10test.sdk10test
  19.  
  20. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at java.lang.Class.newInstance(Native Method)
  21.  
  22. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.app.Instrumentation.newActivity(Instrumentation.java:1095)
  23.  
  24. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)
  25.  
  26. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2147)
  27.  
  28. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)
  29.  
  30. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1572)
  31.  
  32. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.os.Handler.dispatchMessage(Handler.java:88)
  33.  
  34. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.os.Looper.loop(Looper.java:123)
  35.  
  36. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at android.app.ActivityThread.main(ActivityThread.java:3708)
  37.  
  38. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at java.lang.reflect.Method.invokeNative(Native Method)
  39.  
  40. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at java.lang.reflect.Method.invoke(Method.java:492)
  41.  
  42. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734)
  43.  
  44. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
  45.  
  46. 08-21 10:06:53.853: ERROR/AndroidRuntime(1395):     at dalvik.system.NativeStart.main(Native Method)
Parsed in 0.048 seconds, using GeSHi 1.0.8.4


what the hell?
Last edited by tim on Thu Aug 21, 2008 1:43 pm, edited 1 time in total.
User avatar
tim
Freshman
Freshman
 
Posts: 7
Joined: Thu Jul 03, 2008 3:05 pm

Top

Postby cgreen » Thu Aug 21, 2008 1:36 pm

what's a Verifier ? :shock:

this is really strange! why can't i make an instance of this class ? it is throwing an incomprehensible exception, looks like google made some mistakes in the new sdk, uh ?
User avatar
cgreen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Wed Jul 16, 2008 10:16 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests