Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ran through it with this code :</p> <p>MainActivity :</p> <pre><code> public class MainActivity extends Activity implements OnScrollListener { ArrayAdapter&lt;String&gt; adapter; GridView gridphoto; Button loadMore; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); gridphoto = (GridView) findViewById(R.id.gridphoto); loadMore = (Button) findViewById(R.id.loadmore); gridphoto.setOnScrollListener(this); adapter= new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1); for (int i = 0; i &lt; 80; i++) { adapter.add("dummy data " + i); } gridphoto.setAdapter(adapter); } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (gridphoto.getLastVisiblePosition() + 1 == 80) { loadMore.setVisibility(View.VISIBLE); // Load More Button } } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { // TODO Auto-generated method stub } } </code></pre> <p>and activity_main.xml</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;GridView android:id="@+id/gridphoto" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android:columnWidth="80dp" android:gravity="center" android:horizontalSpacing="2dp" android:numColumns="auto_fit" android:stretchMode="columnWidth" android:verticalSpacing="2dp" /&gt; &lt;Button android:id="@+id/loadmore" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Load More" android:visibility="gone" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>It works like expected, hope it 'll help</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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