Yes it does load them through different class loaders.  This is working as
intended.

On Thu, Jul 29, 2010 at 7:57 AM, James Wang <jameswangc...@gmail.com> wrote:

> We have two apks A and B which both import one platform library by use-
> library in AndroidManifest.
> And they have the same android:process so they run in the same
> process.
>
> When A is finished and B is started, we got ClassCastException which
> happens like codes below:
>
> CustomedView view = (CustomedView)findViewById(R.id.customedView);
>
> We logged findViewById(R.id.customedView).getClass() ==
> CustomedView.class out  and found it was false.
> So we believe Android loads the same class twice by different
> classloader.
>
> Does anyone know how to get it right although it seems to be a bug of
> Android.
>
> BTW, we found one solution like below but which seems not to be good
> one.
>
> protected void onPause() {
>        super.onPause();
>        Logger.d(TAG, "kill myself");
>        Process.killProcess(Process.myPid());
>    }
>
> Best Regards
>
> James
>
> --
> 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to