This is not a limitation of GridView. Could you post the entire
error/stack trace you are getting when you do this? Your code is using
the wrong LayoutParams. You need to use GridView.LayoutParams, not
LinearLayout.LayoutParams.
On Thu, Oct 23, 2008 at 9:14 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> If I return a View of type Layout from BaseAdapter::getView I'm
> immediately greeting with the error "The application XXX has stopped
> unexpectedly ... " However, if I return an ImageView or TextView the
> error is averted. Does anyone know if this is a limitation of
> GridView?
>
>
> public class GridAdapter extends BaseAdapter {
> public GridAdapter() {
> }
>
> public View getView(int position, View convertView, ViewGroup
> parent) {
>
> if (convertView == null) {
> convertView = new LinearLayout(ParentActivity.this);
> convertView.setLayoutParams(new
> LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
> ViewGroup.LayoutParams.WRAP_CONTENT));
> }
>
> return convertView;
> }
> }
>
> >
>
--
Romain Guy
www.curious-creature.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---