Syntax error on Token "Void", @ expected
run cannot be resolved to a type
Sytax error, insert enumBody to complete BlockStatement!
These are 3 errors I get at the below script. What might be problem? Notice that all unneeded stuff probably belongs to my other functions and stuff. I do have all imports too in reality 🙂
import android.app.Activity;
import android.content.Intent;
public class MainStuff extends Activity {
TextView tere;
TextView dateatm;
TextView timeatm;
String nimi;
String ip;
protected static final int REFRESH = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
// Refresh after 5 sec... //
Thread refresherAplle = new Thread();
public void run(){
try{
int refresherApple = 0;
while (refresherApple < 5000){
sleep(100);
refresherApple = refresherApple + 100;
}
startActivity(new Intent("viimane.voimalus.REFRESHER"));
}
finally{
finish();
}
}
Your Thread definition is incorrect. The semi-colon at the end terminates the statement.
Do it like this instead.
Currently you have a method inside a method. Thats the reason for all the token exceptions.