Skip to content

Instantly share code, notes, and snippets.

@amlcurran
Created July 17, 2013 11:28
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amlcurran/6019691 to your computer and use it in GitHub Desktop.
Save amlcurran/6019691 to your computer and use it in GitHub Desktop.
LoadHideHelperDemo
package com.example.demolhh;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
public class MainActivity extends Activity {
private LoadHideHelper mHideHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mHideHelper = new LoadHideHelper(findViewById(R.id.textView));
new DummyAsyncTask().execute();
}
public class DummyAsyncTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... voids) {
try {
// Simulates loading data
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
mHideHelper.show();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment