layout upgrade causing crash

by Jayesh Salvi » Fri, 04 Sep 2009 11:40:12 GMT


Sponsored Links
 Hi,
In that app I am developing (
 http://www.cyrket.com/package/com.altcanvas.readerscope ), I updated the
layout file in the latest version - I changed the order of some Views and
changed a LinearLayout to RelativeLayout. I heard from users and also
verified myself that a regular upgrade from old version to the new version
causes a crash. The crash is because of a ClassCastException for a
LinearLayout. I do see this kind of error during development - what I do is,
I do a clean build and then upgrade and it solves the problem. But that
doesn't seem to be the case here.

Is this happening because the upgrade doesn't wipe out old layout files?

After searching for the issue, I came across the warning about unusually
deep and/or broad hierarchies (
 http://android-developers.blogspot.com/2009/04/future-proofing-your-apps.html ).
My layout is not much deeper (max depth 5), but it is wider (total elements
more than 30). Do you think that has anything to do with this? However note
that a clean install of the latest version doesn't cause any problem, only
the upgrade from previous version leads to the layout related crash.

Has anyone else faced problem like this?

Please let me know.

Thanks,
Jayesh

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



Other Threads

1. How can the vold detect the SD card insert/remove?

Vold use socket(PF_NETLINK, SOCK_DGRAM,NETLINK_KOBJECT_UEVENT)
(vold.c) to receive messages from kernel about add/change/remove
modules. When user insert sd-card, kernel create device object with
name /sys/devices/platform/.../mmcblk0 and send broadcast message to
user space...




-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Device Or Resource Busy on RFCOMM reconnect

I'm developing an application that interfaces with an RFCOMM endpoint.
Through bluetooth, my Droid phone connects to this device, initializes
it, and happily sends and receives data.

A problem I have encountered however is when I walk away from the
device (while it's sending/receiving) and the bluetooth connection
goes stale. I easily detect this in my code by various exceptions
thrown by the inputstream/outputstream/socket. When this happens, I
immediately "disconnect" from the endpoint by doing the following:

try {
  if (instream != null ) instream.close();
  if (outstream != null ) outstream.close();
  if (mobdSock != null ) mobdSock.close(); // this is the socket.
} catch... etc.

So after performing the above steps to officially "disconnect" the
dead connection I thought the connection is clean and ready for a new
connect()...

But what happens is when I come back into range of the device and try
to connect, I am unable to reconnect, no matter how many times I try.
connect() throws this exception: java.io.IOException: Device or
resource busy

The only way I can then reconnect to the device is to disable
bluetooth on my droid, then re-enable it. Then my app is able to re-
connect just fine.

BluetoothDevice -> BluetoothAdapter -> BluetoothSocket -> InputStream/
OutputStream.

I'm currently tearing down the connect from the socket to the right
(see above). Should I be tearing it down all the way down to the
adapter instead? or the device? By setting those to null so GC can
clean them up? This is the best idea I can come up with but it doesn't
feel right.

Thanks
Brad

-- 

3. Jual android di bandung

4. Issue with HelloWorld.

5. Adding additional activities to a project

6. Scrolling list of clickable 'rows'

7. TableLayout