Hello, I'd like to make a Gallery in android. In order to set the adapter in need to get the gallery which I defined in my xml file. Im doing that as: Gallery g = (Gallery) findViewById(R.id.gallery1); But with this code I can't compile my project, since I get the Error "Cannot cast from View to Gallery". My xml-file looks like this: "
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Gallery android:id="@+id/gallery1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
/>
</LinearLayout>
Anybody knows how to solve my problem? Thanks a lot