Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid RealViewSwticher problem
    primarykey
    data
    text
    <p>Many of you know, that there's is a class RealViewSwticher created by Marc Reichelt <a href="http://marcreichelt.blogspot.com/2010_09_01_archive.html" rel="nofollow">http://marcreichelt.blogspot.com/2010_09_01_archive.html</a></p> <p>If someone used or uses this thing, please can you help me.</p> <p>Here's my .xml : </p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;de.marcreichelt.android.RealViewSwitcher android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/real_view_switcher"&gt; &lt;GridView android:id="@+id/gridView1" android:layout_width="match_parent" android:layout_height="match_parent"&gt;&lt;/GridView&gt; &lt;GridView android:id="@+id/gridView2" android:layout_width="match_parent" android:layout_height="match_parent"&gt;&lt;/GridView&gt; &lt;/de.marcreichelt.android.RealViewSwitcher&gt; &lt;/LinearLayout&gt; </code></pre> <p>And here's my main class.</p> <pre><code>public class MyMain extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); RealViewSwitcher realViewSwitcher = (RealViewSwitcher)findViewById(R.id.real_view_switcher); GridView gridview = (GridView) findViewById(R.id.gridView1); GridView gridview2 = (GridView) findViewById(R.id.gridView2); gridview.setAdapter(new ImageAdapter(this)); gridview2.setAdapter(new ImageAdapter(this)); realViewSwitcher.setOnScreenSwitchListener(onScreenSwitchListener); } private final RealViewSwitcher.OnScreenSwitchListener onScreenSwitchListener = new RealViewSwitcher.OnScreenSwitchListener() { @Override public void onScreenSwitched(int screen) { // this method is executed if a screen has been activated, i.e. the screen is completely visible // and the animation has stopped (might be useful for removing / adding new views) Log.d("RealViewSwitcher", "switched to screen: " + screen); } }; } </code></pre> <p>I really don't understand what i am doing wrong, in the Example there's comment how to use it in xml: </p> <pre><code> // note that you can also define your own views directly in a resource XML, too by using: // &lt;de.marcreichelt.android.RealViewSwitcher // android:layout_width="fill_parent" // android:layout_height="fill_parent" // android:id="@+id/real_view_switcher"&gt; // &lt;!-- your views here --&gt; // &lt;/de.marcreichelt.android.RealViewSwitcher&gt; </code></pre> <p>The problem is: It is not working. I can see only my main GridView and i can't scroll to the second. If soemeone knews how where i made a mistake or if someone knews another way to do a real scrolling between views, please answer this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload