Note that there are some explanatory texts on larger screens.

plurals
  1. POpreloader between activities - android java
    primarykey
    data
    text
    <p>I'm a android newbie.</p> <p>I need to create some kind of preloader for the Activity. Right now I click the button say "Show company" and afterwards I go to the next activity where the data is loaded from serwer and shown inside. The problem is that (from what I understand) the activity is connecting with internet and until connections is done nothing is show. User must wait and then suddelny (after few seconds - varies) he gets new 100% ready page based on new activity.</p> <p>The best for me would be sth like: create a loding animation that is shown until the activity is fully loaded. (that would solve problem everywhere)</p> <p>Alternative would be: loading the new activity before connecting with the internet url. When its loaded it say sth default like "Loading data" until full text is downloaded from url that will replace the first text.</p> <p>Here is the code I use to load text from URL.</p> <pre><code> try { // Create a URL for the desired page URL url = new URL(serwer_url); // Read all the text returned by the server BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String str; while ((str = in.readLine()) != null) { // str is one line of text; readLine() strips the newline character(s) Plain_str = Plain_str + str; } Log.i("Plain read str", Plain_str); in.close(); } catch (MalformedURLException e) { } catch (IOException e) {} //end of reading file //here is the anchor to the text in activity TextView MainText = (TextView)findViewById(R.id.TextMain); MainText.setText(Html.fromHtml(Plain_str.toString())); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload