BitmapFactory.decodeStream problem for Android 4.1.2 or grater

  • Replies:0
arif komurculer
  • Forum posts: 16

Oct 17, 2013, 10:41:50 PM via Website

Hello friends.
I am developing a software which is sending some picture from pc to android.
it is working for Android 4.0.2 or earlier versions.

But the same code does not work for android 4.2.2 (JB)
Does not return any error message back.

It's all right, but the picture shown in the imageview (on by default have a picture of) an empty changing.

my code are

1private void runTcpImageServer() {
2 ServerSocket ss = null;
3 Boolean end = false;
4 Message msg;
5 Socket s;
6
7
8 //myImg = (ImageView) findViewById(R.id.imgBckGround);
9
10 InputStream in ;
11
12
13 try {
14
15 ss = new ServerSocket(vrSolPort);
16
17 while(!end){
18 //ss.setSoTimeout(10000);
19 //accept connections
20
21 s = ss.accept();
22
23 in = s.getInputStream();
24 //BufferedInputStream bufIn = new BufferedInputStream(in);
25
26 bmpSol= BitmapFactory.decodeStream(in);
27
28
29 s.close();
30
31
32 msg = threadHandlerIMGSol.obtainMessage();
33 msg.obj = "Geldi";
34 threadHandlerIMGSol.sendMessage(msg);
35
36
37 } //while
38 ss.close();
39
40 } catch (Exception e) {
41 /*
42 Toast.makeText(getBaseContext(), e.getMessage(),
43 Toast.LENGTH_SHORT).show();
44 */
45 }
46
47
48 }

can you help me

Reply