title: what syntax do I use in a new function to duplicate functionality of code in oncreate method
body: <p>Trying this again</p>
  
  <p>I have this samplet of code it is not complete but it should get my point accross</p>
  
  <pre><code> public class MainActivity extends Activity {
  
      ListView list1;
      LazyAdapter adapter;
      String nUdid;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          final Context context = this;
          setContentView(R.layout.main);
          TextView viewtitle1 = (TextView) findViewById(R.id.textView1);
  
          JSONObject j = new JSONObject();
          try {
              j.put("action", "udid_get_products");
              j.put("success", "true");
              j.put("content", "udid product list");
              j.put("data", nUdid);
          } catch (JSONException e1) {
              e1.printStackTrace();
          }
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost("http://www.xxxxxxxxx.com/yyyy/test.php");
      }
  }
  </code></pre>
  
  <p>This snippet of code exists in the oncreate method</p>
  
  <p>What I need to do is this</p>
  
  <pre><code> public class MainActivity extends Activity {
  
      ListView list1;
      LazyAdapter adapter;
      String nUdid;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          setContentView(R.layout.main);
          myNewFunction();
      }
  
  
      public void myNewFunction() {
          final Context context = this;
          TextView viewtitle1 = (TextView) findViewById(R.id.textView1);
  
          JSONObject j = new JSONObject();
          try {
              j.put("action", "udid_get_products");
              j.put("success", "true");
              j.put("content", "udid product list");
              j.put("data", nUdid);
          } catch (JSONException e1) {
              e1.printStackTrace();
          }
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost("http://www.xxxxxxxxx.com/yyyy/test.php");
      }
  }
  </code></pre>
  
  <p>Will this work exactly as is or do I need to do something additional in the () following the function name myNewFunction. Is the snippet  'Bundle savedInstanceState' in the oncreate method needed in myNewFunction syntax or not.</p>