2017-05-20 17 views
-2

私はこのコールバックがどのパッケージかを知りたいと思っています。私はライブロケーションを見つけるためにMapActivityでこれを使用しています。アンドロイドスタジオでコールバックを解決できません

コールバックsubscribeCallback =新しいコールバック(){

@Override 
    public void successCallback(String channel, Object message) { 
     JSONObject jsonMessage = (JSONObject) message; 
     try { 
      double mLat = jsonMessage.getDouble("lat"); 
      double mLng = jsonMessage.getDouble("lng"); 
      mLatLng = new LatLng(mLat, mLng); 
     } catch (JSONException e) { 

     } 

     runOnUiThread(new Runnable() { 
      @Override 
      public void run() { 
       updatePolyline(); 
       updateCamera(); 
       updateMarker(); 
      } 
     }); 
    } 
}; 

答えて

0

パブリッククラスMapsActivityはFragmentActivityが、それはのコールバックを解決できない、同じままさ

+0

問題OnMapReadyCallback {

private GoogleMap mGoogleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } @Override public void onMapReady(GoogleMap googleMap) { mGoogleMap = googleMap; initializeMap(); } private PolylineOptions mPolylineOptions; private void initializeMap() { mPolylineOptions = new PolylineOptions(); mPolylineOptions.color(Color.BLUE).width(10); } private LatLng mLatLng; Callback subscribeCallback = new Callback() { @Override public void successCallback(String channel, Object message) { JSONObject jsonMessage = (JSONObject) message; try { double mLat = jsonMessage.getDouble("lat"); double mLng = jsonMessage.getDouble("lng"); mLatLng = new LatLng(mLat, mLng); } catch (JSONException e) { } runOnUiThread(new Runnable() { @Override public void run() { updatePolyline(); updateCamera(); updateMarker(); } }); } }; private void updatePolyline() { mGoogleMap.clear(); mGoogleMap.addPolyline(mPolylineOptions.add(mLatLng)); } private void updateMarker() { mGoogleMap.addMarker(new MarkerOptions().position(mLatLng)); } private void updateCamera() { mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mLatLng, 16)); } 

}を実装して延びていますなぜ私はこのコールバックがどのクラスのものか知りたいのですが –

関連する問題