title: cannot resolve method 'getwindow()' in Activity
body: <p>am trying to add this this line in my Activity   <code>builder.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);</code></p>
  
  <p>but I find find this error Cannot resolve method'getwindow'</p>
  
  <p>as am trying to add my code like this</p>
  
  <pre><code>        NewGuestCheck.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  AlertDialog.Builder builder = new AlertDialog.Builder(TabsActivity.this);
                  builder.setTitle("Insert Table Name");
                  // Set up the input
                  final EditText input = new EditText(TabsActivity.this);
              InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
              imm.showSoftInput(input, InputMethodManager.SHOW_IMPLICIT);
  // Specify the type of input expected; this, for example, sets the input as a password, and will mask the text
                  input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_CLASS_TEXT);
                  builder.setView(input);
                  // Set up the buttons
                  builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          final String Table_Name = input.getText().toString();
                          AlertDialog.Builder builder = new AlertDialog.Builder(TabsActivity.this);
                          builder.setTitle("Insert number of Covers");
                          // Set up the input
                          final EditText input2 = new EditText(TabsActivity.this);
  // Specify the type of input expected; this, for example, sets the input as a password, and will mask the text
                          input.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_CLASS_NUMBER);
                          builder.setView(input2);
                          // Set up the buttons
                          builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  String Cover_check = input2.getText().toString();
                                  TablesFragment.Check_Items = ConnectionClass.Ret_dt("Select * From ChecksItems Where Check_ID = 0");
                                  if (!TablesFragment.Check_Items.containsKey("Change_Temp")) {
                                      if (TablesFragment.Check_Items.size() &gt; 0) {
                                          ArrayList&lt;Object&gt; Valrows = new ArrayList&lt;Object&gt;();
                                          if (TablesFragment.Check_Items.get("Item_ID").size() &gt; 0) {
                                              for (int i = 0; i &lt; TablesFragment.Check_Items.get("Item_ID").size(); i++) {
                                                  Valrows.add("");
                                              }
                                          }
                                          TablesFragment.Check_Items.put("Change_Temp", Valrows);
                                      }
                                  }
                                  if (Integer.parseInt(Cover_check) &gt; 0) {
                                      String st = ConnectionClass.Ret_Col("Select  Max (CheckSerail) AS Ser From Checks_V where Officer = 0 AND OutLet_ID = " + ConnectionClass.OutletID + " And Rest_ID_Active = " + ConnectionClass.Rest_ID);
                                      if (st.trim() == "")
                                          st = "0";
                                      int Check_Serial = Integer.parseInt(st) + 1;
                                      long Check_ID = Long.parseLong(ConnectionClass.SelectNewIDCheck());
                                      st = "insert into Checks .......
                                  }
                              }
                          });
                          builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  dialog.cancel();
                              }
                          });
  
                          builder.show();
                      }
                  });
                  builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.cancel();
                      }
                  });
                  builder.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
                  builder.show();
  </code></pre>
  
  <p>as I need from this method that when the alert dialog start the keyboard starts automatically that I don't need to touch the edit text to show the key board
  sorry if any thing is not clear and sorry for my bad english
  I hope this case could be solved</p>
  
  <p>by the way activity looks</p>
  
  <pre><code>public class TabsActivity extends AppCompatActivity {
  </code></pre>