title: onCreate() method with if-else condition
body: <p>I am calling an activity namely LoginActivity.java in which i am getting values using Intent, storing data to SQLite, fetching data from SQLite and given a small condition, condition looks like this:</p>
  
  <pre><code> if(txtEvent.getText().toString().equals("") &amp;&amp; txtOperative.getText().toString().equals(""))
                  {
                      Intent intentCall = new Intent(LoginActivity.this, LicenseListActivity.class);
                      startActivity(intentCall);
                  }
  </code></pre>
  
  <p>Now, how App works:-</p>
  
  <pre><code>Splash Screen &gt; LoginActivity (if txtEvent and txtOperative equals to null) then calling &gt; LicenseListActivity &gt; GetEventsActivity &gt; GetOperativesActivity (passing some values mainly EVENT &amp; OPERATIVE name) to LoginActivity (also storing to database - checked using SQLite DB Viewer) 
  </code></pre>
  
  <p>So issue is, instead of calling <strong>LoginActivity.java</strong> its calling LicenseListActivity.java again, after GetOperativesActivity.java ?</p>
  
  <p><strong>GetOperativesActivity.java:-</strong></p>
  
  <pre><code>// Launching new screen on Selecting Single ListItem
          lv.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                      int position, long id) {
                  firstName = contactList.get(position).get(TAG_NAME);
                  Intent intent = new Intent(GetOperativesActivity.this, LoginActivity.class);
                  intent.putExtra("name", name);
                  intent.putExtra("deviceID", deviceID);
                  intent.putExtra("emailID", emailID);
                  intent.putExtra("firstName", firstName);
                  startActivity(intent);                
              }
          });
  </code></pre>
  
  <p><strong>LoginActivity.java:-</strong></p>
  
  <pre><code>@Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
          setContentView(R.layout.activity_login);
  
          btnLogout = (Button) findViewById(R.id.btnLogout);
          btnCamera = (Button) findViewById(R.id.btnCamera);
          btnGallery = (Button) findViewById(R.id.btnGallery);
  
              txtDeviceID = (TextView) findViewById(R.id.txtDeviceID);
              txtEmailID = (TextView) findViewById(R.id.txtEmailID);      
              txtEvent = (TextView) findViewById(R.id.txtEvent);  
              txtOperative = (TextView) findViewById(R.id.txtOperative);
              txtEventOperator = (TextView) findViewById(R.id.txtEventOperator);
  
               Intent intent = getIntent();
               deviceID = intent.getStringExtra("deviceID");
               emailID = intent.getStringExtra("emailID");
               event = intent.getStringExtra("name"); 
               operative = intent.getStringExtra("firstName");
  
               txtDeviceID.setText(deviceID);
               txtEmailID.setText(emailID);
               txtEvent.setText(event);
               txtOperative.setText(operative);
               txtEventOperator.setText(event + "  " + operative);
  
               strEvent = txtEvent.getText().toString();
               strOperative = txtOperative.getText().toString();
  
                  // Dialog
                  final AlertDialog.Builder adb = new AlertDialog.Builder(this);
                  AlertDialog ad = adb.create();
  
                  // new Class DB
                  final myDBClass myDb = new myDBClass(this);
  
                  // Save Data
                  long saveStatus = myDb.InsertData(
                              txtDeviceID.getText().toString(),
                              txtEmailID.getText().toString(),
                              txtEvent.getText().toString(),
                              txtOperative.getText().toString(),
                              txtEventOperator.getText().toString()
                              );
  
                  if(saveStatus &lt;=  0)
                  {
                    ad.setMessage("Error!! ");
                    ad.show();
                    return;
                  }   
  
                  // Show Data
                  String arrData[] = myDb.SelectData();
                  if(arrData != null)
                  {
                      txtDeviceID.setText(arrData[1]);
                      txtEmailID.setText(arrData[2]);
                      txtEvent.setText(arrData[3]);
                      txtOperative.setText(arrData[4]);
                      txtEventOperator.setText(arrData[5]);
                  }  
  
                  if(txtEvent.getText().toString().equals("") &amp;&amp; txtOperative.getText().toString().equals(""))
                  {
                      Intent intentCall = new Intent(LoginActivity.this, LicenseListActivity.class);
                      startActivity(intentCall);
                  }
  
  }
  </code></pre>
  
  <p>If you have any question in your mind, please let me know ...</p>