Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Change</p> <pre><code>LayoutInflater li = LayoutInflater.from(context); </code></pre> <p>to</p> <pre><code>LayoutInflater li = LayoutInflater.from(arg0.getContext()); </code></pre> <p>and change</p> <pre><code>AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); </code></pre> <p>to</p> <pre><code>AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(arg0.getContext()); </code></pre> <p>Your <code>context</code> variable is <code>null</code> because you initialize it before the <code>Activity</code> is created. And you don't need to create a <code>context</code> variable inside of an <code>Activity</code>. If, for whatever reason (maybe its simplicity) you want to use the variable then declare it where you are but initialize it inside of <code>onCreate()</code></p> <p>Also, inside the <code>onClick()</code> signature, I would change the variable name to something meaningful but that's not required. Like chanig </p> <pre><code>public void onClick(View arg0) </code></pre> <p>to</p> <pre><code>public void onClick(View v) </code></pre> <p><strong>Edit</strong></p> <p>You also need to change these lines</p> <pre><code>EditText username = (EditText) findViewById(R.id.txt_name); EditText password = (EditText) findViewById(R.id.password); </code></pre> <p>to</p> <pre><code>EditText username = (EditText) dialog_layoutView.findViewById(R.id.txt_name); EditText password = (EditText) dialog_layoutView.findViewById(R.id.password); </code></pre> <p>This will tell them to look in <code>dialog_layout</code>. Currently they are looking in the <code>layout</code> that you inflated with <code>setContentView()</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload