Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <LinearLayout
  2. android:id="@+id/figura"
  3. android:text="COLOR"
  4. android:textColor="@android:color/black"
  5. android:textSize="20dp"
  6. android:orientation="vertical"
  7. android:layout_width="match_parent"
  8. android:layout_height="150dp"
  9. android:visibility="visible"
  10. android:background="@android:color/holo_green_dark">
  11. </LinearLayout
  12.  
  13. <texview
  14. android:id="@+id/reloj"
  15. android:text="i"
  16. android:layout_width="match_parent"
  17. android:layout_height="200dp"/>
  18.  
  19.  
  20.  
  21.  
  22. @Override
  23. public int onStartCommand(Intent intent, int flags, int startId) {
  24. super.onStartCommand(intent, flags, startId);
  25. if(workerThread == null || !workerThread.isAlive()){
  26. workerThread = new Thread(new Runnable() {
  27. public void run() {
  28.  
  29. for (int i = 1; i>0; i++){
  30.  
  31. try{
  32. Thread.sleep( 30000 );
  33. }catch (Exception e){
  34. e.printStackTrace();
  35. }
  36.  
  37. // layout.figura.background=(FF00FF00FF)
  38. // layout.setVisibility(figura.INVISIBLE);
  39.  
  40.  
  41.  
  42. }
  43. });
  44. workerThread.start();
  45.  
  46. }
  47. return START_STICKY;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement