2016-08-16 3 views
0

私はinfowindow内のカウントダウンタイマーを使用したいと思いますが、タイマーの値は背景で変化していますが、textviewは更新していません。あなたが達成しようとしているどのようなアイデアカウントダウンマーカー内のinfowindow

mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { 
             @Override 
             public View getInfoWindow(final Marker marker) { 
              myMarker = mMarkersHashMap.get(marker); 
              runOnUiThread(new Runnable() { 
               @Override 
               public void run() { 
                timer1 = new CountDownTimer(Long.parseLong(myMarker.getTime()), 1000) { 
                 @Override 
                 public void onTick(long millisUntilFinished) { 

                  String hms = String.format("%02d:%02d", 
                    TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished), 
                    TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) - 
                      TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished))); 
                  Log.d("fsdf", hms); 
                  infoTitle.setText(hms); 

                  String check=infoTitle.getText().toString(); 
                  if(!check.equals(null)) { 
                   Log.d("check 1", hms); 
                   if (!check.equals(hms)) { 
                    Log.d("check 2", hms); 
                    infoTitle.setText(hms); 
                    marker.showInfoWindow(); 

                   } 
                  } 

                 } 

                 @Override 
                 public void onFinish() { 
                  infoTitle.setText("00"); 
                 } 

                }.start(); 
               } 
              }); 


              infoButtonListener.setMarker(marker); 

              mapWrapperLayout.setMarkerWithInfoWindow(marker, infoWindow); 
              return infoWindow; 
             } 

             @Override 
             public View getInfoContents(Marker marker) { 


              return null; 
             } 
            }); 

`

+0

タイマーが働いているが、それは動作していませんマーカー情報ウィンドウの内側 – nigin

答えて

関連する問題