Hi,
Please see the solution in the thread below and let us know if that works
for you.
http://groups.google.com/group/android-developers/browse_thread/thread/261ce958a8599bfc/c30aaa7ec9f92d8c
If it does, perhaps we can include it in the documentation.
-Megha
On Tue, May 13, 2008 at 1:59 AM, x-files <[EMAIL PROTECTED]> wrote:
>
> I have exception with objects which were loaded by differents
> loaders.
>
> View is loading
> Java code:
> public init() {
>
> try {
> Context context = this.createPackageContext("package.name",
> CONTEXT_IGNORE_SECURITY|CONTEXT_INCLUDE_CODE);
> CustomView customView = new CustomView(context);
> //Custom view is declared at another eclipse project
> ((ViewGroup)findViewById(R.id.content)).addView(new
> CustomView(context), new LayoutParams(LayoutParams.WRAP_CONTENT,
> LayoutParams.WRAP_CONTENT));
> } catch (Exception e) {
> Log.e("ERROR!",e.getMessage());
> e.printStackTrace();
> }
> }//throws ClassCastException
>
> //durin tests at view
> CustomView viewc = new CustomView;
> View view = findViewById(R.id.custom_view1);
> viewc = (CustomView)view; //throws ClassCastException
>
>
>
> 1) view.getClass().getName().equals(CustomView.class.getName()) -
> it's
> true
> 2) view instanceof CustomView - it's false
> 3) CustomView.class.getClassLoader().getClass().getName() return
> BootClassLoader
> 4) view.getClass().getClassLoader().getClass().getName() return
> PathClassLoader
>
> Any ideas?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---