Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

SwipeRefreshLayout

public class ActivityMain extends FragmentActivity implements OnRefreshListener {

    private SwipeRefreshLayout mSwipeRefreshLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_main);
        mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.container);
        mSwipeRefreshLayout.setOnRefreshListener(this);

        super.onCreate(savedInstanceState);
    }

    @Override
    public void onRefresh() {
        Toast.makeText(this, "Refresh", Toast.LENGTH_SHORT).show();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                mSwipeRefreshLayout.setRefreshing(false);
            }
        }, 2000);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: latest android version 
Java :: regex double quote java 
Java :: how to empty list in java 
Java :: jcolorchooser in java 
Java :: Syntax of how to create ArrayList in Java 
Java :: abstract code in java 
Java :: Compare integers java sort 
Java :: convert object array to int array java 
Java :: java string join 
Java :: dockerfile for spring boot app 
Java :: java read from file word by word 
Java :: if checkbox checked java 
Java :: how to get cpu model number in android programmatically 
Java :: reader 
Java :: Java List Add Elements using add() method 
Java :: flutter unable to find bundled java version 
Java :: java try-with-resources 
Java :: add recyclerview in fragment 
Java :: jsp initialization 
Java :: android studio hide linearlayout 
Java :: java mostrar resultados ventana grafica 
Java :: quebra de linha java 
Java :: java unique queue 
Java :: algorithm to know if a number is an integer 
Java :: convert base64 to pdf object for pdf reader in android studio 
Java :: arraylist remove name in java 
Java :: java selection sort 
Java :: how to sort arraylist in java 
Java :: jsoup remove element 
Java :: java program to search item from name in class 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =