I have a method that I need to run when the activity starts.
I’ve tried putting it in the OnCreate but the onCreate is called twice if the activity is left untouched for a while (and that’s the case, i’m checking for online updates… so it takes some time)
that’s why i can’t put the update method in the onCreate
any ideas?
Thank you,
Ron
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.options);
checkUpdate();
}
private void checkUpdate(){
Runnable runnable = new Runnable() {
public void run() {
try
{
// create a web request to check if i have the latest update
HttpClient client = new DefaultHttpClient();
.
.
.
.
.
};
new Thread(runnable).start();
Use a boolean to determine if the activity is already started.