The Gallery view style and its smooth scrolling animation is quite
elegant, fluidly connecting multiple screens of data together using
intuitive scrolling keypresses. However, it seems that Gallery might
be coded to only allow ImageViews to be displayed in each of its
gallery frames. I've been trying to have my Gallery display different
views such as a buttons, textviews, or relativelayouts instead of
ImageViews, but nothing has worked so far. I'm modifying the sample
code from:
http://code.google.com/android/samples/ApiDemos/src/com/google/androi...

My getView code in the adapter [called RELadapter, which extends
BaseAdapter], in the most simplistic form, looks like this, but I get
null pointers and nothing works:

 public View getView(int position, View convertView, ViewGroup parent)
{
        RelativeLayout i = (RelativeLayout) findViewById(R.id.ae);
       return i
            }


xml Code:

<?xml version="1.0" encoding="utf-8"?>

<Gallery xmlns:android="http://schemas.android.com/apk/res/android";
android:id="@+id/gallery"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
/>



ERROR/AndroidRuntime(1336): Uncaught handler: thread Main exiting due
to uncaught exception
ERROR/AndroidRuntime(1336): java.lang.NullPointerException
ERROR/AndroidRuntime(1336):     at test$RELAdapter.getView(test.java:
59)
ERROR/AndroidRuntime(1336):     at
android.widget.BaseAdapter.getMeasurementView(BaseAdapter.java:74)
ERROR/AndroidRuntime(1336):     at
android.widget.AbsSpinner.onMeasure(AbsSpinner.java:230)
ERROR/AndroidRuntime(1336):     at android.view.View.measure(View.java:
5937)
ERROR/AndroidRuntime(1336):     at
android.view.ViewGroup.measureChild(ViewGroup.java:2219)
ERROR/AndroidRuntime(1336):     at
android.widget.FrameLayout.onMeasure(FrameLayout.java:146)
ERROR/AndroidRuntime(1336):     at android.view.View.measure(View.java:
5937)



I've tried with really simple views such as buttons and textviews, and
nothing works. Any help is appreciated. If it is truly not possible,
are there any other widgets that would suit this purpose? My fall-back
is probably just to link my pages with some sort of animation so the
user has the same mental image of the layout structure as he/she would
gain from a gallery. Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to