package us.blauha.wmsdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.TileOverlayOptions;
import com.google.android.gms.maps.model.TileProvider;

public class MainActivity extends android.support.v4.app.FragmentActivity {

    /*	GOAL:
     *  Display a WMS overlay from OSGEO on top of a google base map.
     *  (The data is a white map with state boundaries.)
     *
     *  Create a debugging Maps API Key and add it to the manifest.
     *
     */
    private GoogleMap mMap;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setUpMapIfNeeded();
    }

    private void setUpMapIfNeeded() {
        if (mMap == null) {
            ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                    .getMapAsync(new OnMapReadyCallback() {
                        @Override
                        public void onMapReady(GoogleMap googleMap) {
                            mMap = googleMap;
                            setUpMap();
                        }
                    });
        }
    }

    private void setUpMap() {
        TileProvider wmsTileProvider = TileProviderFactory.getOsgeoWmsTileProvider();
        mMap.addTileOverlay(new TileOverlayOptions().tileProvider(wmsTileProvider));

        // Because the demo WMS layer we are using is just a white background map, switch the base layer
        // to satellite so we can see the WMS overlay.
        mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
    }
}
@@ -705,36 +705,8 @@
   */
-%0A    private GoogleMap mMap;
 %0A%0A  
@@ -870,113 +870,8 @@
 n);%0A
-        setUpMapIfNeeded();%0A    %7D%0A%0A    private void setUpMapIfNeeded() %7B%0A        if (mMap == null) %7B%0A    
     
@@ -968,20 +968,16 @@
         
-  
-  
 .getMapA
@@ -1028,20 +1028,16 @@
         
-    
 @Overrid
@@ -1058,20 +1058,16 @@
         
-  
-  
 public v
@@ -1128,175 +1128,8 @@
     
-     
-   mMap = googleMap;%0A                            setUpMap();%0A                        %7D%0A                    %7D);%0A        %7D%0A    %7D%0A%0A    private void setUpMap() %7B%0A    
     
@@ -1210,25 +1210,46 @@
 ();%0A        
-m
+                google
 Map.addTileO
@@ -1312,25 +1312,24 @@
 ider));%0A
-%0A
         
 // Becau
@@ -1324,212 +1324,39 @@
     
-// Because the demo WMS layer we are using is just a white background map, switch the base layer%0A        // to satellite so we can see the WMS overlay.%0A        mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE
+            %7D%0A                %7D
 );%0A 

remove extraneous code from Main