Android Open Source - Yet-Another-Pull-to-refresh-ListView Main Activity






From Project

Back to project page Yet-Another-Pull-to-refresh-ListView.

License

The source code is released under:

GNU General Public License

If you think the Android project Yet-Another-Pull-to-refresh-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.example.testpulltorefresh;
//  w  w  w. j  a va2  s .  c o  m
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ((PullToRefreshView) findViewById(R.id.listview)).getListView().setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    static String[] data = {
            "kk", "kkjkk", "kkk", "kjdkfjkdfj", "Mac book pro", "X230",
            "kk", "kkjkk", "kkk", "kjdkfjkdfj", "Mac book pro", "X230",
            "kk", "kkjkk", "kkk", "kjdkfjkdfj", "Mac book pro", "X230",
            "kk", "kkjkk", "kkk", "kjdkfjkdfj", "Mac book pro", "X230",
    };
}




Java Source Code List

com.example.testpulltorefresh.LoadingView.java
com.example.testpulltorefresh.MainActivity.java
com.example.testpulltorefresh.PullToRefreshView.java