I am getting NullPointer exception for my app when switching from potrait mode to landscape mode and vice versa

by manoj » Wed, 11 Feb 2009 13:02:22 GMT


Sponsored Links
 Hi friends,

I have written a small example which displays the photos from the
server.

Its working fine when the device is in one of the mode (landscape of
potrait ).

But if I switch to landscape to potrait or potrait  to landscape while
downloading the photos from the server,

I am getting NullPointerException, showing with
androidRunTimeException.

Can any one please help to solve this problem?

I am using LinearLayout -> ImageView

I am using threads to download the images.

Thanks,
Manoj.
--~--~---------~--~----~------------~-------~--~----~



I am getting NullPointer exception for my app when switching from potrait mode to landscape mode and vice versa

by clark » Wed, 11 Feb 2009 13:15:16 GMT


 You may want to try adding android:configChanges="orientation" to
AndroidManifest.xml and overriding onConfigurationChanged().  If a
configuration change is not specified in android:configChanges then
Android will take care of it for you, which means restarting your
app.  Without seeing code it is hard to say exactly what you should do
to handle this, but the information I listed should get you started.
I'd do a search regarding onConfigurationChanged() in the SDK
documentation.

I hope that gets you going in the right direction.


~clark



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


I am getting NullPointer exception for my app when switching from potrait mode to landscape mode and vice versa

by Mark Murphy » Wed, 11 Feb 2009 21:59:38 GMT


 


Without the source code for the area where the exception is occurring,
and knowing which line is the one raising the exception, it is rather
difficult to give you a precise solution.

Bear in mind that, on a rotation like this, by default your existing
activity is destroyed and a new one created.

Here is a series of blog posts on handling rotation events that may help
you understand what is going on:

 http://androidguys.com/?s=rotational +forces

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. OOT permisi mau kenalan :)

Selamat sore 

Permisi newbie izin mau bergabung di komunitas ini.. 
Terima kasih pada tim moderator yang telah mengijinkan saya mengikuti komunitas 
ini.. 

Salam kenal + met berbuka buat yang berpuasa :) 


 
Regards
Dzikki

--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

2. tanya flash ROM magic ke hero lag

HTC Hero yang akan beredar di Indonesia adalah  "android banci"  tidak
tertanam GMS.

Aneh ya bisnis model Google ?




On Sep 15, 9:06pm, Subanindiyo Ardi <subanindiyo.a...@gmail.com>



--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

3. powerd.c

4. Tracking down libdvm crash

5. Problem with integration of Zxing to my app

6. scrollbarSize problem]]]

7. tool for Android performance measure