package net.wigle.wigleandroid;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by bobzilla on 8/28/16
 */
public class ShareActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        // Get the intent that started this activity
        final Intent intent = getIntent();

        // Figure out what to do based on the intent type
        MainActivity.info("ShareActivity intent type: " + intent.getAction());
        switch (intent.getAction()) {
            case Intent.ACTION_INSERT:
                MainActivity.getMainActivity().handleScanChange(true);
                break;
            case Intent.ACTION_DELETE:
                MainActivity.getMainActivity().handleScanChange(false);
                break;
            case Intent.ACTION_SYNC:
                MainActivity.getMainActivity().doUpload();
                break;
            default:
                MainActivity.info("Unhandled intent action: " + intent.getAction());
        }

        Intent result = new Intent("com.example.RESULT_ACTION");
        setResult(Activity.RESULT_OK, result);
        finish();
    }
}

@@ -665,32 +665,146 @@
 t.getAction());%0A
+        final MainActivity mainActivity = MainActivity.getMainActivity();%0A        if (mainActivity != null) %7B%0A    
         switch (
@@ -829,32 +829,36 @@
 ) %7B%0A            
+  
+  
 case Intent.ACTI
@@ -876,33 +876,37 @@
                 
-M
+    m
 ainActivity.getM
@@ -901,34 +901,16 @@
 ctivity.
-getMainActivity().
 handleSc
@@ -933,39 +933,47 @@
                 
+   
+ 
 break;%0A
+    
             case
@@ -1011,33 +1011,21 @@
         
-MainActivity.getM
+    m
 ainActiv
@@ -1027,18 +1027,16 @@
 Activity
-()
 .handleS
@@ -1061,39 +1061,47 @@
                 
+    
 break;%0A
+    
             case
@@ -1137,33 +1137,21 @@
         
-MainActivity.getM
+    m
 ainActiv
@@ -1153,18 +1153,16 @@
 Activity
-()
 .doUploa
@@ -1174,32 +1174,36 @@
                 
+    
 break;%0A         
@@ -1205,16 +1205,20 @@
         
+ 
+   
 default:
@@ -1218,16 +1218,20 @@
 efault:%0A
+    
         
@@ -1299,32 +1299,46 @@
 t.getAction());%0A
+            %7D%0A
         %7D%0A%0A     

fix npe ShareActivity L29