Search Android contacts more efficiently Is there is better way to do that more efficiently?

onCreate():

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    layout = new Layout();
    Event event = new Event(layout);
}


Layout and Event:

class Layout
{
    public Layout()
    {
         txtName = (EditText)findViewById(R.id.txtName);
         btnSerch = (Button)findViewById(R.id.btnSerch);
        group1 = (RadioGroup)findViewById(R.id.group1);
    }
    RadioGroup group1;
    EditText txtName;
    Button btnSerch;
}

class Event
{
    public Event(Layout layout)
    {
        layout.btnSerch.setOnClickListener(new start_Serch());
    }
}

class start_Serch implements OnClickListener
{
    @Override
    public void onClick(View view)
    {
        Serch(view, layout);
    }
    Layout layout;
}


Main goal: (the main commands of the application)

void Serch(View v, Layout layout)
{
    Uri Contacts = android.provider.ContactsContract.Contacts.CONTENT_URI;

    Cursor C = getContentResolver().query(Contacts, null, null, null, null);

    if(C != null)
    {
        if(C.moveToFirst())
        {
            do
            {
                String display_ContactsName = getValue(C, android.provider.ContactsContract.Contacts.DISPLAY_NAME);

                if (Check(display_ContactsName, C) == true)
                {
                    break;
                }

            }while (C.moveToNext());
        }
    }
}


getValue() and Check():

private String getValue(Cursor cursor, String name)
{
    return cursor.getString(cursor.getColumnIndex(name));
}
private boolean Check(String Name, Cursor C)
{
    boolean Found = false;
    int id = layout.group1.getCheckedRadioButtonId();
    switch (id)
    {
        case -1:
            break;
        case R.id.fullName:
            if (layout.txtName.getText().toString().equals(Name))
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);

                alert.setTitle("Hey This Contact Is in the LIST!!! yay you are the best lasy man EVER SO G***");

                alert.setMessage("The contact "+Name+" was found in this phone... oh ya");

                alert.setPositiveButton("ok",new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialogInterface, int i)
                    {
                    }
                });
                alert.show();
                Found = true;
            }
            break;
        case R.id.Contane:
            if ( Name.toLowerCase().contains ( layout.txtName.getText ().toString ().toLowerCase()))
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);

                alert.setTitle("this is the first result for the name that you typed");

                alert.setMessage("The contact "+Name+" was found in this phone... oh ya");

                alert.setPositiveButton("ok",new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialogInterface, int i)
                    {
                    }
                });
                alert.show();
                Found = true;
                break;
            }
    }

     if (C.isLast() == true&amp;&amp;layout.txtName.getText().toString().equals(Name) == false&amp;&amp; Name.toLowerCase().contains ( layout.txtName.getText ().toString ().toLowerCase()) == false)
    {
        AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this);

        alert.setTitle("Hey This Contact Is NOT in the LIST!!!");

        alert.setMessage("The contact/part of "+layout.txtName.getText().toString()+" was not found in this phone...");

        alert.setPositiveButton("ok",new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialogInterface, int i)
            {
            }
        });
        alert.show();
    }
    return Found;
}
Android Strings

Android provides a nice way of externalizing Strings in a strings.xml resource file. Using it right from the start of your project or as soon as possible is a very good idea, you might regret it later if you don't. Using XML-resources in Android is how to provide internationalization of your application. It is also good to keep all strings in one place, so you can get a nice overview of the strings shown in your application.

Speaking of Strings that are showing in your application, the content of your message String for your AlertDialogs is very questionable. If I as an user would encounter the message "f*ck ya" in an application, I would never ever give it a 5 star rating on Google Play. And it honestly does not give me a good impression of you as a person either.

The "ok" message is already defined as a string message in Android, and if your dialog button should only close the dialog then you can pass null as the listener. So therefore you can use alert.setPositiveButton(android.R.string.ok, null); which greatly improves code readability.

Readability

Speaking of code readability... I feel that you have an excessive amount of empty lines in your code, including but not restricted to:

if(C != null)

{

            alert.setPositiveButton("ok",new DialogInterface.OnClickListener() {

                @Override

                public void onClick(DialogInterface dialogInterface, int i)


        do

        {

            String display_ContactsName = getValue(C, android.provider.ContactsContract.Contacts.DISPLAY_NAME);


Instead consider this:

if(C != null)
{
    ...
    alert.setPositiveButton("ok",new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i)
    ...
        do
        {
            String display_ContactsName = getValue(C, android.provider.ContactsContract.Contacts.DISPLAY_NAME);