Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old December 21st, 2011, 11:50 PM   #1 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 6
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Gridview child view removal/replacement

Hi everyone - I'm new to Andoid development. I'm currently working on an app that has a number of views within a Gridview (Imageviews, Textviews and Linearlayout). Upon clicking the mouse button I would like to replace the existing views with new views. Where I currently have an imageview for example could be replaced with a TextView.

I cannot figure out how to do this - I have tried various calls which suggest they delete these objects and the code does compile but then when I run it it crashes.

Any suggestions on how to do this would be appreciated.

szw21 is offline  
Reply With Quote
Sponsors
Old December 31st, 2011, 06:42 AM   #2 (permalink)
Premium Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
 
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
Default

Your program is crashing because an exception is being thrown. The clue to fixing your problem is going to be in what exception was thrown and why was it thrown. This information will be in the exception trace that's logged into Eclipse's console view.

Please post that exception trace.
jiminaus is offline  
Reply With Quote
Old January 2nd, 2012, 12:19 AM   #3 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 6
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jiminaus View Post
Your program is crashing because an exception is being thrown. The clue to fixing your problem is going to be in what exception was thrown and why was it thrown. This information will be in the exception trace that's logged into Eclipse's console view.

Please post that exception trace.
Hi thanks - yes I managed to figure it out using the debugger. I cannot recall the exact reason as I have written a lot more code since posting this but the exception that was thrown gave clues to the problem. It mainly arose as a result of copying and pasting code from another section which was not appropriate to the LinearLayout I had placed with child views in one of the grid positions.

I've started using the debugger a lot more since.
szw21 is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:20 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo