[android-developers] Re: Trouble inflating a view

2008-12-03 Thread CaseyB
I made the change you suggested but I still get the same error. It's dying down in the code that's trying to layout the screen it looks like. Hmmm On Dec 2, 11:23 am, Romain Guy [EMAIL PROTECTED] wrote: Hi, The line: View.inflate(FileBrowser.this, R.layout.icon, null); Should be:

[android-developers] Re: Trouble inflating a view

2008-12-03 Thread CaseyB
Ok, I am not sure exactly what the problem was but I fixed it my creating the layout in code and instantiating an instance of it instead of trying to inflate it from xml. On Dec 3, 4:18 pm, CaseyB [EMAIL PROTECTED] wrote: I made the change you suggested but I still get the same error.  It's

[android-developers] Re: Trouble inflating a view

2008-12-03 Thread Romain Guy
Apparently you were inflating a View from an adapter and putting that View in the wrong parent, which caused the ClassCastException. On Wed, Dec 3, 2008 at 10:22 PM, CaseyB [EMAIL PROTECTED] wrote: Ok, I am not sure exactly what the problem was but I fixed it my creating the layout in code

[android-developers] Re: Trouble inflating a view

2008-12-02 Thread Romain Guy
Hi, The line: View.inflate(FileBrowser.this, R.layout.icon, null); Should be: LayoutInflate.from(FileBrowser.this).inflate(R.layout.icon, parent, false); You have to pass the parent so that the generated layout parameters are of the right type. In the case of a GridView, it is also important