about android project
<p>I have elseif statement in which i declare  flag is false and i declare</p>

<pre><code>Resources r = getResources();
String refrigerant;
String[] refrigerant1 = r.getStringArray(R.array.refrigerant);
</code></pre>

<p>in my program want to set flag=true but my for loop is not executed and flag remains false 
pls give me solution.</p>

<p>is there any problem in array declaration?</p>

<pre><code>else if (ref_flg == true &amp;&amp; ptflg == false)
{
for (int i1 = 0; i1 &lt; refrigerant1.length; i1++)
{
    if (refrigerant == "")
    {
        if (et1.getText().toString()== refrigerant1[i1])
        {
            flag = true;
            System.out.println("flag"+flag);

        }
    }
    else
    {
        if (refrigerant == refrigerant1[i1])
        {
            System.out.println("refrigerant"+refrigerant);
            flag = true;
            System.out.println("flag"+flag);
        }
    }
}
if (flag == true)
{
    if (refrigerant == "")
    {
        if (et1.getText().toString() != "")
        {
            refrigerant = et1.getText().toString();


        }
    }
    temp_flg = true;

    et1.setText("");
}
else
{
    System.out.println("flag"+flag);
    alertDialog.setTitle("Reset...");
    alertDialog.setMessage("Enter Valid REF");
    alertDialog.setButton2("OK", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            // here you can add functions
            dialog.dismiss();
        }
    });
    alertDialog.setIcon(R.drawable.icon);
    alertDialog.show(); 
    ref_flg = false;
}
  }
</code></pre>
