i get a NetworkOnMainThreadException, but as as i see it, it is not in the main thread. Here is my code(i use the library from svnkit.com)
public class MainActivity extends Activity{
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
sendFiles();
} catch (Exception e) {
e.printStackTrace();
}
}
});
thread.run();
}
void sendFiles() throws SVNException, IOException {
DAVRepositoryFactory.setup();
SVNURL url = SVNURL.parseURIEncoded("...");
SVNRepository repository = DAVRepositoryFactory.create(url);
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager( "...", "...".toCharArray() );
repository.setAuthenticationManager( authManager );
long r= repository.getLatestRevision();
}
}
the exception is thrown at repository.getLatestRevision();
(and of course catched in run()
). Can anyone explain to me, why?