Android Open Source - paged-listview Abstract Paged Activity






From Project

Back to project page paged-listview.

License

The source code is released under:

MIT License

If you think the Android project paged-listview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.github.alexkolpa.pagedlistview.sample;
/*from   ww  w  . ja v  a  2  s.co m*/
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import com.github.alexkolpa.pagedlistview.PagedListView;

public class AbstractPagedActivity extends ActionBarActivity {

  protected MyPageable mPageable;
  protected PagedListView mListView;
  protected ArrayAdapter<String> mAdapter;

  protected void loadListView() {
    mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);

    mPageable = new MyPageable(mAdapter);

    mListView = (PagedListView) findViewById(R.id.paged_listview);
    mListView.setAdapter(mAdapter);
    mListView.setPageable(mPageable);
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case R.id.refresh:
        mAdapter.clear();
        mPageable.resetPage();
        return true;
    }
    return super.onOptionsItemSelected(item);
  }
}




Java Source Code List

com.github.alexkolpa.pagedlistview.PagedListView.java
com.github.alexkolpa.pagedlistview.sample.AbstractPagedActivity.java
com.github.alexkolpa.pagedlistview.sample.CustomActivity.java
com.github.alexkolpa.pagedlistview.sample.FooterActivity.java
com.github.alexkolpa.pagedlistview.sample.MainActivity.java
com.github.alexkolpa.pagedlistview.sample.MyPageable.java