Re: [android-developers] Re: android 2.1 issue

2010-08-27 Thread Dianne Hackborn
On Fri, Aug 27, 2010 at 12:14 AM, Indicator Veritatis wrote:

> If it "wasn't very useful", then why is it still appearing on a stack
> trace in 2.1? Android itself is using it, so it must be useful --
> unless you still have a lot of useless crap that needs to be removed
> even from 2.1;)
>

It's part of the framework implementation.  There are lots of things in the
internal framework impl that you'll see in stack traces.


> And what did you hope to achieve by hedging, saying "may have been"?
> It WAS included. I found it in the copy of the docs at
> http://www.androidjavadoc.com/1.0_r1_src/android/app/ActivityThread.html
> It is (was) in the android.app package. So if it is no longer
> supported, it should have been marked in newer SDK's as deprecated.
> Why wasn't it?
>

Oh...  what the heck is that?  That isn't official documentation.  It looks
like someone is generating Java docs from the raw source code, but not
taking into account the @hide annotations to hide things from the SDK docs
that aren't available to apps.  I wouldn't trust anything I see in that doc.


> In any case, I take it the modern way of managing the execution of the
> Activity's main thread is to use Handler and Looper, NOT use
> ActivityThread, leaving all other 'managing' of the thread to the
> system.
>

ActivityThread has *never* been an application API.  It doesn't have
anything intended for direct use by apps.  You also don't manage the main
app thread; the framework does that, with this and various other classes.
 You can just use the normal Handler facility to enqueue messages/runnables
on the main thread.

-- 
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

Re: [android-developers] Re: android 2.1 issue

2010-08-26 Thread Dianne Hackborn
ActivityThread is a private implementation of the framework.  It may have
been accidentally included in the SDK in 1.0, but if it was it wasn't very
useful.

On Thu, Aug 26, 2010 at 7:47 PM, Indicator Veritatis wrote:

> Just to make sure we know exactly which method you are really talking
> about, it is always a good idea to specify which package the method
> under discussion is in. I assume you are talking about the
> openStream() method of the URL class in package java.net (openstream
> came up with exact matches only in posts).
>
> If so, the answer is yes, it is still supported. In fact, it is hard
> to imaging using the URL class without it.
>
> I'll give away another little trade secret too: I figured this out by
> doing a Google query with keys "android developer openstream".
>
> So now that we know your first guess was wrong, openStream() is still
> supported, your stack trace only tells us a null pointer exception
> (NPE) took place, but it does not show which line of your code might
> have triggered this.
>
> Now what I would like to know is why the ActivityThread mentioned in
> your trace is documented in the 1.0 version of the Android Javadocs,
> but not in the most current (2.2) online docs. But this might not help
> here anyway.
>
> Back to your problem: when the internal Android code comes back with a
> NPE, it usually means you left something uninitialized or improperly
> initialized: I often see this, for example, with the MediaPlayer if
> the URL is not squeaky clean and the website online. But since you
> gave a stack trace including only our own code, we cannot help you
> figure out which thing was left improperly initialized.
>
> On Aug 22, 4:30 pm, AUandroid  wrote:
> > Hi All,
> >
> > I have a app that runs properly on andorid 1.6 and on my test G1
> > phone. It is force closing on the new Android 2.1 phones.I am parsing
> > XML( from internet) and displaying in a listview.   Is the
> > openstream() method no longer supported. If I debug the app in api
> > level 7, xml is correctly parsed when I step execute it, as soon as I
> > hit continue the app gives the following stack. Any ideas?
> >
> > here is the stack
> >
> > Thread [<3> main] (Suspended (exception NullPointerException))
> > ViewRoot.draw(boolean) line: 1373
> > ViewRoot.performTraversals() line: 1114
> > ViewRoot.handleMessage(Message) line: 1633
> > ViewRoot(Handler).dispatchMessage(Message) line: 99
> > Looper.loop() line: 123
> > ActivityThread.main(String[]) line: 4363
> > Method.invokeNative(Object, Object[], Class, Class[], Class, int,
> > boolean) line: not available [native method]
> > Method.invoke(Object, Object...) line: 521
> > ZygoteInit$MethodAndArgsCaller.run() line: 860
> > ZygoteInit.main(String[]) line: 618
> > NativeStart.main(String[]) line: not available [native method]
>
> --
> 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
>



-- 
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