Code example for ExpandableListView

Methods: setIndicatorBounds

        /* Get the screen width */ 
        DisplayMetrics dm = new DisplayMetrics();
        int width = dm.widthPixels;
        expListView.setIndicatorBounds(width - getDipsFromPixel(60), width
                - getDipsFromPixel(5)); 
    // Convert pixel to dip 
    public int getDipsFromPixel(float pixels) {
        // Get the screen's density scale 
        final float scale = getResources().getDisplayMetrics().density;
        // Convert the dps to pixels, based on density scale 
        return (int) (pixels * scale + 0.5f);
Stop searching for code, let great code find you!  Add Codota to your java IDE