Note that there are some explanatory texts on larger screens.

plurals
  1. POcheck the ascii code for arabic letters and showing an error message?
    text
    copied!<p><em><strong>i want to check the text if it was arabic show the letter in the other text if it is for example was english or korean show the error message saying enter an arabic text but it shows the error message both ways if i write arabic or english or any other language and iam 100% sure about the letters i entered on the text matches the ascii on the if statment so what iam i doing wrong ??!!!</em></strong> </p> <p>public class MainActivity extends Activity {</p> <pre><code>EditText te1; EditText te2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); te1 = (EditText) findViewById(R.id.t1); te2 = (EditText) findViewById(R.id.t2); final AlertDialog ad; ad = new AlertDialog.Builder(this).create(); ad.setTitle("رسالة خطأ"); ad.setMessage("رجاء ادخل نص عربي "); ad.setButton("موافق^_*", new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { // TODO Auto-generated method stub dialog.dismiss(); } }); final Button v = (Button) findViewById(R.id.b1); v.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub // imva.setImageResource(R.id.b1); for ( int j = 0 ; j &lt; te1.length() ; j++) { String l = te1.toString(); char coverLetter =l.charAt(j); if ((coverLetter &gt;= 1569) &amp;&amp; (coverLetter &lt;= 1594) || (coverLetter &gt;= 1600) &amp;&amp; (coverLetter&lt;= 1610)) { te2.setText("غ "); } else { ad.show(); } }// for } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } </code></pre> <p>}</p>
 

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