python748 / alternate-java-bridge-library

Automatically exported from code.google.com/p/alternate-java-bridge-library
Apache License 2.0
0 stars 0 forks source link

Image Picture URL causes NetworkOnMainThreadException #177

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  On android 3.0+, if you create a brand new app and just try to set an 
aBImage component Picture to a URL in Screen Initialized the 
NetworkOnMainThreadException exception gets thrown, e.g.

private void screenInitialized() {
        // This method is run when the screen is initialized, and reports a valid width/height. 

        aBImage1.Picture("http://b.vimeocdn.com/ps/322/524/3225240_30.jpg");
    }

What is the expected output? What do you see instead?
Expected output is an image. Instead it force closes the app (on android 3.0+).

What version of the product are you using? On what operating system?
Latest version of altBridge jar 8 June 2013 19:01:34, Windows 7 64 bit.

Please provide any additional information below.
See here 
https://groups.google.com/d/topic/alternate-java-bridge-library-discussion/EAwC8
kHA9ZY/discussion

Original issue reported on code.google.com by phantomf...@gmail.com on 24 Jun 2013 at 8:09

GoogleCodeExporter commented 8 years ago
Looks like this is a bigger problem than just with Image in screen initialize. 
If you try to set the Image of any component on android 3.0+, you will get that 
error.

This is going to take some thought.

Original comment by IMPINC...@gmail.com on 27 Jun 2013 at 12:55

GoogleCodeExporter commented 8 years ago
Ouch. A quick and dirty quick fix is to set Strict Mode to off. 
StrictMode.ThreadPolicy policy = new 
StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);

But is not considered a good idea.

Original comment by phantomf...@gmail.com on 28 Jun 2013 at 11:38

GoogleCodeExporter commented 8 years ago

Original comment by bric...@gmail.com on 12 Jul 2013 at 8:56