There is my code and action after sink.close();
should change text of the textview but it isn't happening. Why?
protected void runNet() throws IOException {
try{
final OkHttpClient client = new OkHttpClient();
final Request request = new Request.Builder()
.url("http://uprojects.pl/radiowezel/questions.db")
.build();
Response response = client.newCall(request).execute();
QuestionsDB db = new QuestionsDB(context);
File downloadedFile = new File(context.getDatabasePath("questions.db"), "");
BufferedSink sink = Okio.buffer(Okio.sink(downloadedFile));
sink.writeAll(response.body().source());
sink.close();
status.setText("Baza została zaktualizowana");
}catch(UnknownHostException e){
status.setText ("Brak połączenia przy pobieraniu");
}
}