This file contains 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
/** | |
* Creates background color with shadow effect - programmatically | |
* | |
* @param color the background color | |
*/ | |
private LayerDrawable setLayerShadow(String color) { | |
GradientDrawable shadow; | |
int strokeValue = 6; | |
int radiousValue = 2; | |
try{ |
This file contains 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
//Async method | |
public void requestInputAsync() { | |
//The worker does all the work for you. | |
BackgroundWorker requestInputWorkerNew = new BackgroundWorker (); | |
requestInputWorkerNew.DoWork += new DoWorkEventHandler (delegate(object o, DoWorkEventArgs args) { | |
//Do all the async work here but for God's sake don't mess with the UI Thread | |
} | |
}); | |
requestInputWorkerNew.RunWorkerCompleted += new RunWorkerCompletedEventHandler( |
This file contains 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
//Declare variable and execute async | |
DownloadFilesTask mDonwloadFilesTask; | |
mDonwloadFilesTask = new DownloadFilesTask(); | |
mDonwloadFilesTask.execute(""); | |
//---------------------------------- | |
public class DownloadFilesTask extends AsyncTask<String, Void, String> { | |
protected String doInBackground(String... params) { | |
//do all the heavy staff here but dont you dare messing with the UI! | |
return "Executed!"; | |
} |