I'm trying to have my network code run of a thread. I have a class that inherits from Thread. When I try to create a instance of it,
cSecureThread cRun=new cSecureThread();
I get the following error: "No enclosing instance of type cBitrex is accessible"
here is the code block
public class cSecureThread extends Thread {
String reply=null;
String url;
public void run()
{
// GetSecureBitrexApi(url);
}
};
static String fn;
static String GetSecureBitrexApiThread( String url)
{
// Line below creats error
cSecureThread cRun=new cSecureThread();
cRun.url=url;
System.out.println("XXXXXXXXXXXXXXXXX start thread XXXXXXXXXXXXXXXXXXXX");
cRun.start();
try {
// wait 10 seconds to make api call
cRun.join(1000*30);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("XXXXXXXXXXXXXXXXX end thread XXXXXXXXXXXXXXXXXXXX");
fn= cRun.reply;
return fn;
}