android- menu settings customization
<p>i added settings option in android menu. it works fine while testing in emulator. but when i try in device it wont change.. can i know what is the problem? Do i need to change anything in androidmanifest.xml file.<br>
following is my code:   </p>

<pre><code>@Override
public boolean onCreateOptionsMenu(Menu menu)
{
    menu.add(1,1,0,"Settings").setIcon(R.drawable.ic_tab_settings_grey);
    setMenuBackground();
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item)
{
    switch(item.getItemId())
    {
    case 1:
        Intent in = new Intent(TransactionSummaryActivity.this, WelcomePage.class);
        startActivity(in);
        finish();
        return true;

    default:
        return true;
    }

}
protected void setMenuBackground(){  

           getLayoutInflater().setFactory( new Factory() {  
            @Override
            public View onCreateView(String name, Context context, AttributeSet attrs) {
                // TODO Auto-generated method stub

                 if ( name.equalsIgnoreCase( "com.android.internal.view.menu.IconMenuItemView" ) ) {  

                       try { // Ask our inflater to create the view  
                           LayoutInflater f = getLayoutInflater();  
                           final View view = f.createView( name, null, attrs );  
                           new Handler().post( new Runnable() {  
                               public void run () {  
                                   view.setBackgroundResource(R.drawable.menu_selector);  
                                  // view.setBackgroundColor(Color.parseColor("#257CB5"));

                                  ((TextView) view).setTextColor(Color.WHITE);

                               }  
                           } );  
                           return view;  
                       }  
                       catch (InflateException e) {}  
                       catch (ClassNotFoundException e) {}  
                   }  
                return null;
            }  
           });  
       }
</code></pre>
