title: Where to put activity code?
body: <p>so I have a code that checks something and I put it in the <code>onCreate()</code> of an Activity. I want to know if it's correct to put it there and also, for some reason the code that checks the Main Activity doesn't work at all, the second one which has a toast works. I think the problem may be in an AlertDialog. Here's the one with the toast:</p>
  
  <pre><code>AlertDialog.Builder Dial = new AlertDialog.Builder(Screen.this);
  Dial.setTitle(R.string.Dial_Tit);
  Dial.setMessage(R.string.Dial_Mes);
  Dial.setPositiveButton("OK", PosBC());
  Dial.setNegativeButton(R.string.Dial_NegBC, NegBC());
  Dial.show();
  </code></pre>
  
  <p>Note: both buttons have methods, I just didn't post them. The problem is that the alert doesn't even show. And also for some reason the toast does work, it like automatically clicks thebutton, even thought the method has  an intent which doesn't work.</p>
  
  <p>More code as requested:</p>
  
  <pre><code>    private DialogInterface.OnClickListener NegBC() {
      Intent moveToStart;
      moveToStart = new Intent(Screen.this, Launch.class);
      startActivity(moveToStart);
      return null;
  }
  
  private DialogInterface.OnClickListener PosBC() {
      startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
      Toast.makeText(getApplicationContext(), R.string.settingsToast, Toast.LENGTH_LONG).show();
      return null;
  }
  </code></pre>
  
  <p><strong>Update</strong>: I've added the <code>create()</code> method which shows the dialog but it goes like this : when activity is created shows toast, press back goes to settings, press back from settings shows dialog, buttons don't work.</p>