This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Android Resources


On 05/18/2009 09:32 PM, Clinton Ebadi wrote:
With a bit of futzing around I was able to get a hello world application
working with Android 1.5, but I'm running into an issue with using the
autogenerated resource class. I changed the classpath to

${external-libs-folder}/kawa.jar:${android-jar}:${out-classes}

and this /seemed/ to pick up the definition of R from R.class, but when
I tried:

   (define-simple-class KawaHello (android.app.Activity)
     ((onCreate (sIS :: android.os.Bundle)) :: void
        (invoke-special android.app.Activity (this) 'onCreate sIS)
        ((this):setContentView R:.layout:.main)))

It built with a few warnings and then proceeded to crash and burn. I
tried replacing R:... with:

(static-field (static-field R 'layout) 'main)

And got:

     [kawa] ...  no slot `layout' in kawa.android.hello.R
     [kawa] ... warning - more than one possibly applicable method
      'setContentView' in kawa.android.hello.KawaHello

The path kawa.android.hello.R rather than kawa.android.R suggests it is looking for R in the wrong package. I suggested trying a fully-qualified package name: kawa.android.R.

I also suggest leaving out the dots - kawa.android.R:layout:main
rather than awa.android.R:.layout:.main - the dots are kind-of
deprecated.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]