// Create ImageView Dynamically int img1_id,img2_id; ImageView img_view = new ImageView(this); img_view.setBackgroundResource(R.drawable.bulb); img_view.setId(j); ll.addView(img_view); img_view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case 0: img1_id=v.getId(); break; case 1: img2_id=v.getId(); break;}}});
Runnable run=new Runnable() { @Override public void run() { receive_Data();//function called here } }; public void receive_Data() { try { if(GlobalClass.socket.isConnected()) { GlobalClass.buffer_len=GlobalClass.socket.getInputStream().available(); if(GlobalClass.buffer_len>0) { GlobalClass.socket.getInputStream().read(GlobalClass.buffer,0,GlobalClass.buffer_len); switch(GlobalClass.buffer[25]) { case 0x08: switch(GlobalClass.buffer[30]) { case 0x00: /// here is where I need to change the image. break; case 0x01: /// here is where I need to change the image. break } } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)