• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Gridview child view removal/replacement

szw21

Lurker
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.
 
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.
 
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.
 
Back
Top Bottom