Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks Marcus! It works on 2.3 smoothly by fixing some syntax errors, here's the fixed code</p> <pre><code> protected void setMenuBackground() { getLayoutInflater().setFactory(new Factory() { @Override public View onCreateView(final String name, final Context context, final AttributeSet attrs) { if (name.equalsIgnoreCase("com.android.internal.view.menu.IconMenuItemView")) { try { // Ask our inflater to create the view final LayoutInflater f = getLayoutInflater(); final View[] view = new View[1]; try { view[0] = f.createView(name, null, attrs); } catch (InflateException e) { hackAndroid23(name, attrs, f, view); } // Kind of apply our own background new Handler().post(new Runnable() { public void run() { view[0].setBackgroundColor(Color.WHITE); } }); return view[0]; } catch (InflateException e) { } catch (ClassNotFoundException e) { } } return null; } }); } static void hackAndroid23(final String name, final android.util.AttributeSet attrs, final LayoutInflater f, final View[] view) { // mConstructorArgs[0] is only non-null during a running call to // inflate() // so we make a call to inflate() and inside that call our dully // XmlPullParser get's called // and inside that it will work to call // "f.createView( name, null, attrs );"! try { f.inflate(new XmlPullParser() { @Override public int next() throws XmlPullParserException, IOException { try { view[0] = (TextView) f.createView(name, null, attrs); } catch (InflateException e) { } catch (ClassNotFoundException e) { } throw new XmlPullParserException("exit"); } }, null, false); } catch (InflateException e1) { // "exit" ignored } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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