Hi Dianne,

    Thanks a lot for your suggestion. Problem has been solved as I had
passed the Context of the application as an argument of invoked method
display().

Regards,

Asif

On May 14, 10:22 am, Dianne Hackborn <hack...@android.com> wrote:
> You seem to be passing in a bad ContextWrapper that somehow has a null base
> pointer:
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
>   85     public Toast(Context context) {
>
>   86         mContext = context;
>
>   87         mTN = new TN(context);
>
>   88         mY = context.getResources().getDimensionPixelSize(
>
>   89                 com.android.internal.R.dimen.toast_y_offset);
>
>   90     }
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
>   76     @Override
>
>   77     public Resources getResources()
>
>   78     {
>
>   79         return mBase.getResources();
>
>   80     }
>
>
>
>
>
> On Wed, May 13, 2009 at 9:34 PM, Ask <asifk1...@gmail.com> wrote:
>
> > Fadden,
>
> >   It throws these exceptions only when " I tried to create any UI
> > component like Toast message or invoking phone dialer inents etc. " It
> > executes nicely when I just "tried to print a log message or created
> > MediaPlayer and playing a song "   .
>
> >  So my conclusion is that It throws NullPointerException only when
> > invoked code has a UI component.
>
> >  Note: same thing I had tried using the normal desktop java
> > application using swing and excuted nicely with UI component also. So
> > Is this a bug in android or some other way to do it.
>
> > Thanks,
>
> > Asif
>
> > On May 14, 3:28 am, fadden <fad...@android.com> wrote:
> > > On May 13, 8:05 am, Asif k <asifk1...@gmail.com> wrote:
>
> > > >    I had used DexClassLoader to execute the code of other application
> > > > dynamically. I am calling method display() of another application from
> > > > my application. The display() method will just show the Toast pop up.
> > > [...]
> > > > 05-13 20:10:22.336: WARN/System.err(773): Caused by:
> > > > java.lang.NullPointerException
> > > > 05-13 20:10:22.466: WARN/System.err(773):     at
> > > > android.content.ContextWrapper.getResources(ContextWrapper.java:79)
> > > > 05-13 20:10:22.466: WARN/System.err(773):     at
> > > > android.widget.Toast.<init>(Toast.java:88)
> > > > 05-13 20:10:22.477: WARN/System.err(773):     at
> > > > android.widget.Toast.makeText(Toast.java:230)
> > > > 05-13 20:10:22.485: WARN/System.err(773):     ... 25 more
>
> > > > Please Help. Am I missing something??
>
> > > Looks like it was doing something and then hit a null pointer
> > > exception?
>
> --
> 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.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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