sample/src/com/handmark/pulltorefresh/samples/PullToRefreshListFragmentActivity.java
@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_ptr_list_fragment);

		mPullRefreshListFragment = (PullToRefreshListFragment) getSupportFragmentManager().findFragmentById(
				R.id.frag_ptr_list);

		// Get PullToRefreshListView from Fragment
		mPullRefreshListView = mPullRefreshListFragment.getPullToRefreshListView();

		// Set a listener to be invoked when the list should be refreshed.
		mPullRefreshListView.setOnRefreshListener(this);

		// You can also just use mPullRefreshListFragment.getListView()
		ListView actualListView = mPullRefreshListView.getRefreshableView();

		mListItems = new LinkedList<String>();
		mListItems.addAll(Arrays.asList(mStrings));
		mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mListItems);

		// You can also just use setListAdapter(mAdapter) or
		// mPullRefreshListView.setAdapter(mAdapter)
		actualListView.setAdapter(mAdapter);

		mPullRefreshListFragment.setListShown(true);
	}
@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_ptr_list_fragment);

		mPullRefreshListFragment = (PullToRefreshListFragment) getSupportFragmentManager().findFragmentById(
				R.id.frag_ptr_list);

		// Get PullToRefreshListView from Fragment
		mPullRefreshListView = mPullRefreshListFragment.getPullToRefreshListView();

		// Set a listener to be invoked when the list should be refreshed.
		mPullRefreshListView.setOnRefreshListener(this);

		// You can also just use mPullRefreshListFragment.getListView()
		ListView actualListView = mPullRefreshListView.getRefreshableView();

		mListItems = new LinkedList<String>();
		mListItems.addAll(Arrays.asList(mStrings));
		mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mListItems);

		// You can also just use setListAdapter(mAdapter) or
		// mPullRefreshListView.setAdapter(mAdapter)
		actualListView.setAdapter(mAdapter);

		mPullRefreshListFragment.setListShown(true);
	}
@ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_ptr_list_fragment ) ; mPullRefreshListFragment = ( PullToRefreshListFragment ) getSupportFragmentManager ( ) . findFragmentById ( R . id . frag_ptr_list ) ; // Get PullToRefreshListView from Fragment mPullRefreshListView = mPullRefreshListFragment . getPullToRefreshListView ( ) ; // Set a listener to be invoked when the list should be refreshed. mPullRefreshListView . setOnRefreshListener ( this ) ; // You can also just use mPullRefreshListFragment.getListView() ListView actualListView = mPullRefreshListView . getRefreshableView ( ) ; mListItems = new LinkedList < String > ( ) ; mListItems . addAll ( Arrays . asList ( mStrings ) ) ; mAdapter = new ArrayAdapter < String > ( this , android . R . layout . simple_list_item_1 , mListItems ) ; // You can also just use setListAdapter(mAdapter) or // mPullRefreshListView.setAdapter(mAdapter) actualListView . setAdapter ( mAdapter ) ; mPullRefreshListFragment . setListShown ( true ) ; }
Called when the activity is first created.
Called when the activity is first created .