Created
November 29, 2016 02:18
-
-
Save danielmalone/e66bf430716dec3df95aca0169f74e50 to your computer and use it in GitHub Desktop.
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
package com.finepointmobile.multithreading; | |
import android.content.Context; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
new MyCustomLongRunningTask(this, "http://www.cnn.com/api/v1/asdf/whatever/here"); | |
} | |
private class MyCustomLongRunningTask extends AsyncTask<Void, Void, Void> { | |
@Override | |
protected void onPreExecute() { | |
super.onPreExecute(); | |
} | |
private Context mContext; | |
private String mUrl; | |
public MyCustomLongRunningTask(Context mContext, String mUrl) { | |
this.mContext = mContext; | |
this.mUrl = mUrl; | |
} | |
@Override | |
protected Void doInBackground(Void... voids) { | |
return null; | |
} | |
@Override | |
protected void onPostExecute(Void aVoid) { | |
super.onPostExecute(aVoid); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment