Created
July 17, 2013 11:28
-
-
Save amlcurran/6019691 to your computer and use it in GitHub Desktop.
LoadHideHelperDemo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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