I get no results when getting data from database, why? java(android studio












0















In debugging i can see that it puts everything what i need into the sb StringBuilders, but after the second sb the data just disapears and what was prevously written into the safety_string gets deleted aswell, don't know why.



Here is the whole code, changed it a little since i posted.
Still the same, it's not an out of scope, because the result of getting_kat i do receive, only the result of getting_ter is missing.



@Override
public String doInBackground(String... voids) {

String result="";
result=getting_kat();
result+=getting_ter();
//Making sure it gets put into the safety string
safety_string=result;
return result;
}

public String getting_kat(){
String result="";
String resultkat = null;
String connstr = "My connection string";
try {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);


InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultkat = sb.toString();

//Adding a separator for later split
result=resultkat+"#KATEGORIA/TERMEK#";

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter(){
String result="";
String resultter=null;
String connstr2 = "My connection string 2";



try {
URL url = new URL(connstr2);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);

InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultter = sb.toString();

result=resultter;

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}









share|improve this question




















  • 1





    I would recommend that you learn the meaning of DRY. The code repetition is not good. You should encapsulate the work being done here in a simpler method that you can test on the side and use. I'm betting the problem has to do with scope, but it's hard to tell without seeing the entire method.

    – duffymo
    Nov 20 '18 at 14:00
















0















In debugging i can see that it puts everything what i need into the sb StringBuilders, but after the second sb the data just disapears and what was prevously written into the safety_string gets deleted aswell, don't know why.



Here is the whole code, changed it a little since i posted.
Still the same, it's not an out of scope, because the result of getting_kat i do receive, only the result of getting_ter is missing.



@Override
public String doInBackground(String... voids) {

String result="";
result=getting_kat();
result+=getting_ter();
//Making sure it gets put into the safety string
safety_string=result;
return result;
}

public String getting_kat(){
String result="";
String resultkat = null;
String connstr = "My connection string";
try {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);


InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultkat = sb.toString();

//Adding a separator for later split
result=resultkat+"#KATEGORIA/TERMEK#";

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter(){
String result="";
String resultter=null;
String connstr2 = "My connection string 2";



try {
URL url = new URL(connstr2);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);

InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultter = sb.toString();

result=resultter;

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}









share|improve this question




















  • 1





    I would recommend that you learn the meaning of DRY. The code repetition is not good. You should encapsulate the work being done here in a simpler method that you can test on the side and use. I'm betting the problem has to do with scope, but it's hard to tell without seeing the entire method.

    – duffymo
    Nov 20 '18 at 14:00














0












0








0








In debugging i can see that it puts everything what i need into the sb StringBuilders, but after the second sb the data just disapears and what was prevously written into the safety_string gets deleted aswell, don't know why.



Here is the whole code, changed it a little since i posted.
Still the same, it's not an out of scope, because the result of getting_kat i do receive, only the result of getting_ter is missing.



@Override
public String doInBackground(String... voids) {

String result="";
result=getting_kat();
result+=getting_ter();
//Making sure it gets put into the safety string
safety_string=result;
return result;
}

public String getting_kat(){
String result="";
String resultkat = null;
String connstr = "My connection string";
try {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);


InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultkat = sb.toString();

//Adding a separator for later split
result=resultkat+"#KATEGORIA/TERMEK#";

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter(){
String result="";
String resultter=null;
String connstr2 = "My connection string 2";



try {
URL url = new URL(connstr2);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);

InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultter = sb.toString();

result=resultter;

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}









share|improve this question
















In debugging i can see that it puts everything what i need into the sb StringBuilders, but after the second sb the data just disapears and what was prevously written into the safety_string gets deleted aswell, don't know why.



Here is the whole code, changed it a little since i posted.
Still the same, it's not an out of scope, because the result of getting_kat i do receive, only the result of getting_ter is missing.



@Override
public String doInBackground(String... voids) {

String result="";
result=getting_kat();
result+=getting_ter();
//Making sure it gets put into the safety string
safety_string=result;
return result;
}

public String getting_kat(){
String result="";
String resultkat = null;
String connstr = "My connection string";
try {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);


InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultkat = sb.toString();

//Adding a separator for later split
result=resultkat+"#KATEGORIA/TERMEK#";

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter(){
String result="";
String resultter=null;
String connstr2 = "My connection string 2";



try {
URL url = new URL(connstr2);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);

InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8);
StringBuilder sb = new StringBuilder();
String line = "";

//Line by Line reading the data from php

while ((line = br.readLine()) != null) {
sb.append(line+"n");
}

//String it together into one line
resultter = sb.toString();

result=resultter;

br.close();
ips.close();
http.disconnect();

} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}






java database android-studio






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 17:37









Milo Bem

822418




822418










asked Nov 20 '18 at 13:55









GaminatorGaminator

12




12








  • 1





    I would recommend that you learn the meaning of DRY. The code repetition is not good. You should encapsulate the work being done here in a simpler method that you can test on the side and use. I'm betting the problem has to do with scope, but it's hard to tell without seeing the entire method.

    – duffymo
    Nov 20 '18 at 14:00














  • 1





    I would recommend that you learn the meaning of DRY. The code repetition is not good. You should encapsulate the work being done here in a simpler method that you can test on the side and use. I'm betting the problem has to do with scope, but it's hard to tell without seeing the entire method.

    – duffymo
    Nov 20 '18 at 14:00








1




1





I would recommend that you learn the meaning of DRY. The code repetition is not good. You should encapsulate the work being done here in a simpler method that you can test on the side and use. I'm betting the problem has to do with scope, but it's hard to tell without seeing the entire method.

– duffymo
Nov 20 '18 at 14:00





I would recommend that you learn the meaning of DRY. The code repetition is not good. You should encapsulate the work being done here in a simpler method that you can test on the side and use. I'm betting the problem has to do with scope, but it's hard to tell without seeing the entire method.

– duffymo
Nov 20 '18 at 14:00












1 Answer
1






active

oldest

votes


















0














I can't see bug in the code. I cleaned it up a bit for you but it should work both before and after my changes. You don't describe what is actually going wrong with it. In debugging you may just be getting timeout on your connection.



public String doInBackground(String... voids) {
String result = getting_kat() + "#KATEGORIA/TERMEK#" + getting_ter();
//Making sure it gets put into the safety string
safety_string = result;
return result;
}

public String getting_kat() {
String result = "";
String connstr = "My connection string";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter() {
String result = "";
String connstr = "My connection string 2";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

private HttpURLConnection connect(String connstr) throws IOException {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);
return http;
}

private String readFromPhp(HttpURLConnection http) throws IOException {
// try-with-resources - so you don't have to call close()
try (
InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8)
) {
StringBuilder sb = new StringBuilder();

String line;
//Line by Line reading the data from php
while ((line = br.readLine()) != null) {
sb.append(line).append("n");
}

//String it together into one line
return sb.toString();
}
}





share|improve this answer
























  • Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

    – Gaminator
    Nov 21 '18 at 19:18











  • I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

    – Gaminator
    Nov 22 '18 at 8:54











  • what do you mean "result is nothing", how is this code called in your program, what class is this part of?

    – Milo Bem
    Nov 22 '18 at 10:40











  • is this an AsyncTask?

    – Milo Bem
    Nov 22 '18 at 14:30











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53394590%2fi-get-no-results-when-getting-data-from-database-why-javaandroid-studio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I can't see bug in the code. I cleaned it up a bit for you but it should work both before and after my changes. You don't describe what is actually going wrong with it. In debugging you may just be getting timeout on your connection.



public String doInBackground(String... voids) {
String result = getting_kat() + "#KATEGORIA/TERMEK#" + getting_ter();
//Making sure it gets put into the safety string
safety_string = result;
return result;
}

public String getting_kat() {
String result = "";
String connstr = "My connection string";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter() {
String result = "";
String connstr = "My connection string 2";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

private HttpURLConnection connect(String connstr) throws IOException {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);
return http;
}

private String readFromPhp(HttpURLConnection http) throws IOException {
// try-with-resources - so you don't have to call close()
try (
InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8)
) {
StringBuilder sb = new StringBuilder();

String line;
//Line by Line reading the data from php
while ((line = br.readLine()) != null) {
sb.append(line).append("n");
}

//String it together into one line
return sb.toString();
}
}





share|improve this answer
























  • Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

    – Gaminator
    Nov 21 '18 at 19:18











  • I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

    – Gaminator
    Nov 22 '18 at 8:54











  • what do you mean "result is nothing", how is this code called in your program, what class is this part of?

    – Milo Bem
    Nov 22 '18 at 10:40











  • is this an AsyncTask?

    – Milo Bem
    Nov 22 '18 at 14:30
















0














I can't see bug in the code. I cleaned it up a bit for you but it should work both before and after my changes. You don't describe what is actually going wrong with it. In debugging you may just be getting timeout on your connection.



public String doInBackground(String... voids) {
String result = getting_kat() + "#KATEGORIA/TERMEK#" + getting_ter();
//Making sure it gets put into the safety string
safety_string = result;
return result;
}

public String getting_kat() {
String result = "";
String connstr = "My connection string";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter() {
String result = "";
String connstr = "My connection string 2";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

private HttpURLConnection connect(String connstr) throws IOException {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);
return http;
}

private String readFromPhp(HttpURLConnection http) throws IOException {
// try-with-resources - so you don't have to call close()
try (
InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8)
) {
StringBuilder sb = new StringBuilder();

String line;
//Line by Line reading the data from php
while ((line = br.readLine()) != null) {
sb.append(line).append("n");
}

//String it together into one line
return sb.toString();
}
}





share|improve this answer
























  • Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

    – Gaminator
    Nov 21 '18 at 19:18











  • I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

    – Gaminator
    Nov 22 '18 at 8:54











  • what do you mean "result is nothing", how is this code called in your program, what class is this part of?

    – Milo Bem
    Nov 22 '18 at 10:40











  • is this an AsyncTask?

    – Milo Bem
    Nov 22 '18 at 14:30














0












0








0







I can't see bug in the code. I cleaned it up a bit for you but it should work both before and after my changes. You don't describe what is actually going wrong with it. In debugging you may just be getting timeout on your connection.



public String doInBackground(String... voids) {
String result = getting_kat() + "#KATEGORIA/TERMEK#" + getting_ter();
//Making sure it gets put into the safety string
safety_string = result;
return result;
}

public String getting_kat() {
String result = "";
String connstr = "My connection string";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter() {
String result = "";
String connstr = "My connection string 2";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

private HttpURLConnection connect(String connstr) throws IOException {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);
return http;
}

private String readFromPhp(HttpURLConnection http) throws IOException {
// try-with-resources - so you don't have to call close()
try (
InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8)
) {
StringBuilder sb = new StringBuilder();

String line;
//Line by Line reading the data from php
while ((line = br.readLine()) != null) {
sb.append(line).append("n");
}

//String it together into one line
return sb.toString();
}
}





share|improve this answer













I can't see bug in the code. I cleaned it up a bit for you but it should work both before and after my changes. You don't describe what is actually going wrong with it. In debugging you may just be getting timeout on your connection.



public String doInBackground(String... voids) {
String result = getting_kat() + "#KATEGORIA/TERMEK#" + getting_ter();
//Making sure it gets put into the safety string
safety_string = result;
return result;
}

public String getting_kat() {
String result = "";
String connstr = "My connection string";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

public String getting_ter() {
String result = "";
String connstr = "My connection string 2";

try {
HttpURLConnection http = connect(connstr);
result = readFromPhp(http);
http.disconnect();
} catch (MalformedURLException e) {
result = e.getMessage();
} catch (IOException e) {
result = e.getMessage();
}
return result;
}

private HttpURLConnection connect(String connstr) throws IOException {
URL url = new URL(connstr);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("POST");
http.setDoInput(true);
http.setDoOutput(true);
return http;
}

private String readFromPhp(HttpURLConnection http) throws IOException {
// try-with-resources - so you don't have to call close()
try (
InputStream ips = http.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(ips, "UTF-8"), 8)
) {
StringBuilder sb = new StringBuilder();

String line;
//Line by Line reading the data from php
while ((line = br.readLine()) != null) {
sb.append(line).append("n");
}

//String it together into one line
return sb.toString();
}
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 15:37









Milo BemMilo Bem

822418




822418













  • Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

    – Gaminator
    Nov 21 '18 at 19:18











  • I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

    – Gaminator
    Nov 22 '18 at 8:54











  • what do you mean "result is nothing", how is this code called in your program, what class is this part of?

    – Milo Bem
    Nov 22 '18 at 10:40











  • is this an AsyncTask?

    – Milo Bem
    Nov 22 '18 at 14:30



















  • Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

    – Gaminator
    Nov 21 '18 at 19:18











  • I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

    – Gaminator
    Nov 22 '18 at 8:54











  • what do you mean "result is nothing", how is this code called in your program, what class is this part of?

    – Milo Bem
    Nov 22 '18 at 10:40











  • is this an AsyncTask?

    – Milo Bem
    Nov 22 '18 at 14:30

















Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

– Gaminator
Nov 21 '18 at 19:18





Its not the connection, in debugging when i fill the stringbuilders i can see that it gets the data, but after that, the data just gets deleted. Btw i fixed it, idk how it worked but i just used my safety_string to recieve the data in the while() and it worked, but anyway thanks for everyone's help

– Gaminator
Nov 21 '18 at 19:18













I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

– Gaminator
Nov 22 '18 at 8:54





I tried using your code, result in both was nothing, then i introduced two new public strings safety_string_kat and ..._ter, kat works, ter stays empty, so strange, and again when i debug can see that all the data arrives gets put into the string builder and still i get no data at the and, but like i said only when getting_ter is called... fml <3 java

– Gaminator
Nov 22 '18 at 8:54













what do you mean "result is nothing", how is this code called in your program, what class is this part of?

– Milo Bem
Nov 22 '18 at 10:40





what do you mean "result is nothing", how is this code called in your program, what class is this part of?

– Milo Bem
Nov 22 '18 at 10:40













is this an AsyncTask?

– Milo Bem
Nov 22 '18 at 14:30





is this an AsyncTask?

– Milo Bem
Nov 22 '18 at 14:30




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53394590%2fi-get-no-results-when-getting-data-from-database-why-javaandroid-studio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents