On Fri, Mar 11, 2011 at 5:06 PM, Indicator Veritatis <[email protected]>wrote:

> I can't speak for the OP, though he should do the same, but as for me,
> I will avoid calling ActivityThread methods on  your say so. But what
> DID you mean by " Don't call Looper.prepare() on a thread you don't
> own"? In the OP's snippet, he created 'at', and on that thread, he
> calls Looper.prepare(). So he does own it.
>

He didn't create a thread.  He called a private ActivityThread function that
returns an instance of that object for the current thread.  I am sure it is
confusing what this class does with that name, but it is not part of the
SDK, and stuff that isn't in the SDK often has strange names because it is
not a high priority to spend the time renaming it during development to make
it easier to understand.


> Or is there some subtlety to these threads that the standard Java
> security model does not apply, and he does not have the necessary
> permissions to prepare a Looper on the thread he himself created?
>

It's just a matter of someone doing wacky things with private APIs that they
have no idea how they work.

To give you an idea: the code is calling $#&^!! ActivityThread.systemMain().
 You know what that does?  That is a special function that the system
process calls to initialize the framework with some special behavior for
running as part of system code, not as application code.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to