0

I need to draw line at android with drawLine (with canvans) according to response of web service (.net framework 3.5 webservice). Backgraund color should change according to webservices response. How it is possible, thank you.

There was good answer for drawLine refferance: How to draw a line in android

Community
  • 1
  • 1
boy
  • 187
  • 1
  • 9

2 Answers2

0

Well if I am understanding what you are trying to do correctly, you would set up an interface or broadcast receiver that triggers every time your web service retrieves some data. Then depending on the data received you would send a code back to the surface view that is drawing your line and switch based on the received code what line/background color is drawn.

Doug Ray
  • 988
  • 2
  • 9
  • 29
  • Yes you did understand the question quite enough good. Do you have any kind of solution for that? – boy Mar 14 '16 at 08:03
0

If you want to change the color.......

String color=  get your color code from webservice or list
your_ImageView.setBackgroundColor(Color.parseColor(color));
Gaurav Rawal
  • 218
  • 1
  • 6
  • I will try this thank you, and one more thing: it should changed backround color with timer chacking of webservice. Forexample if ws response 1 it will draw red or if 2 it will draw black. – boy Mar 14 '16 at 08:09
  • check your response then use color hexcode accordingly – Gaurav Rawal Mar 14 '16 at 08:11