Sunday 19 May 2013

PullToRefresh in android

Hello Friends, here today i am going to post Pull To refresh sample, It allows a user to refresh a list by pulling down and releasing from the top of the list. Hop this will help you.


Download Source code:

I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.

Thank you :)

Physical Enter key of device in Android


EditText edtsearch=(EditText) findViewById(R.id.search_edttext);
       edtsearch.setOnEditorActionListener(new OnEditorActionListener()
       {

              public boolean onEditorAction(TextView v, int actionId, KeyEvent event)
              {
if(actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_NULL|| event.getKeyCode() == KeyEvent.KEYCODE_ENTER)
                     {                      
                           SearchValue=edtsearch.getText().toString();
InputMethodManager mgr = (InputMethodManager)   getSystemService(Context.INPUT_METHOD_SERVICE);
                           mgr.hideSoftInputFromWindow(edtsearch.getWindowToken(), 0);

                           //Wright your Code here................
                           return true;
                     }
                     else
                     {
                           return false;
                     }
              }
       }


I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.
Thank you :)

Physical back key of device in Android


public boolean onKeyDown(int keyCode, KeyEvent event)
       {
              if ((keyCode == KeyEvent.KEYCODE_BACK))
              {
                     keyCode=KeyEvent.KEYCODE_1;
                     //code here....
              }
              return super.onKeyDown(keyCode, event);
       }