Monday, January 23, 2012

Re: [android-developers] Re: Using multiple API versions

On Mon, Jan 23, 2012 at 5:38 PM, Bret Foreman <bret.foreman@gmail.com> wrote:
>> > Something in the Activity constructor for API 10 is barfing in Android
>> > 2.2.2, which I guess is no real surprise.
>>
>> It's surprising to me. What class is not being found?
>
> The MainActivity class is not being found. In other words, it can't
> instantiate an Activity. This is my first time trying to build at one
> level and run at another. Is it supposed to work?

Absolutely. It's part of the bedrock of Android itself -- the ability
to code to higher API levels yet run them on older devices, so long as
you don't try *executing* anything that is too new (though the story
gets a bit more complicated for Android 1.x). I do it every damn day
and twice on Sundays. :-)

> I'll re-code the section using Build.VERSION and see if I can get the
> other developer to drop that in.

There are certainly places where just handling the runtime exception
is OK (e.g., ActivityNotFoundException), but I wouldn't do that here.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate