ViewFlipper not working inside a class which extends LinearLayout

by Nithin » Thu, 22 Apr 2010 22:59:00 GMT


Sponsored Links
 Hi,

When I tried to create a ViewFlipper inside a class which extends
LinearLayout, its throwing an exception

"java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare()".

I am creating the ViewFlipper using,

ViewFlipper flipper = new ViewFlipper(ctContext);

But when I create the ViewFlipper in a class which extends Activity,
its working normally. What may the reason ?

Nithin

--



ViewFlipper not working inside a class which extends LinearLayout

by Streets Of Boston » Fri, 23 Apr 2010 01:25:50 GMT


 What thread is calling 'new ViewFlipper(ctContext)'?
Is it the main UI-thread?
If not, the calling thread must have a message-loop associated with it
(A looper-thread).
If it's not a looper-thread, you can't call 'new
ViewFlipper(ctContext)' this way.



>


Sponsored Links


ViewFlipper not working inside a class which extends LinearLayout

by Nithin » Fri, 23 Apr 2010 02:07:54 GMT


 Thanks for your reply.. solved the issue..

I put the flipper creation code inside the runOnUIThread() and its
working fine..

Nithin

On Apr 22, 10:25pm, Streets Of Boston <flyingdutc...@gmail.com>



> >



Other Threads

1. mouse pointer position

Hi,

I am trying to get the mouse pointer position from a native
application.
I found out that WindowManagerService maintains the mouse cursor
surface object.

Problem is, I am not able to find any interface or way to extract the
object or the relevant information anyhow.

Please Help. :(

Regards,
Neel.

2. Junit testing on Android

Morning all,

I am currently setting up a number of JUnit tests to get some decent
coverage of my applications.

I have noticed that Android does not seem to produce XML output files
for the JUnit tests run on device I understand that if I like I can
export them via eclipse however this is not an option for me as these
tests will eventually be automated in some form of CI implementation.

Can anyone tell me is it possible to have the tests produce an XML
document onto the device which I can at least use a pull command for?

Tom

3. I do vs I don't care

4. activity stack issue :help please

5. Question about background task applications?

6. Google Map retains the reference to the context of the enclosing activity?

7. Bitmap formats