How to categorize in android?
<p>I have an app in which I have to categorize app into two high  and medium  what I 
want to set app which is on high risk in high column and medium risk in medium column how can I do that,here is code that I am trying to implement but not success</p>

<p>here is code:-</p>

<pre><code>public void _fillRowData(int position, View rootView) {
    if (position == _appHeaderIndex || position == _systemMenacesHeaderIndex) {
        ResultsAdapterHeaderItem obj = (ResultsAdapterHeaderItem) getItem(position);
        ResultsAdapterHeaderItem header = (ResultsAdapterHeaderItem) obj;
        TextView headerText = (TextView) rootView.findViewById(R.id.Titlelabel);
        headerText.setText(header.getDescription());
    } else if (_systemMenacesHeaderIndex == -1 || position &lt; _systemMenacesHeaderIndex) //We are receiving something that is not a header and no system menaces
    {
        final ResultsAdapterProblemItem ri = (ResultsAdapterProblemItem) getItem(position);
        final AppProblem ap = ri.getAppProblem();

        TextView textView = (TextView) rootView.findViewById(R.id.Titlelabel);
        TextView riskText = (TextView) rootView.findViewById(R.id.qualityApp);
        ImageView imageView = (ImageView) rootView.findViewById(R.id.logo);
        if (ap.isDangerous()) {
            riskText.setTextColor(ContextCompat.getColor(getContext(), R.color.HighRiskColor));
            riskText.setText(R.string.high_risk);
        } else {
            riskText.setTextColor(ContextCompat.getColor(getContext(), R.color.MediumRiskColor));
            riskText.setText(R.string.medium_risk);
        }

        RelativeLayout relativeLayout = (RelativeLayout) rootView.findViewById(R.id.itemParent);
        relativeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (_onItemChangedStateListener != null)
                    _onItemChangedStateListener.onItemSelected(ap);
            }
        });
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (_onItemChangedStateListener != null)
                    _onItemChangedStateListener.onItemSelected(ap);
            }
        });


        textView.setText(StaticTools.getAppNameFromPackage(getContext(), ap.getPackageName()));
        imageView.setImageDrawable(StaticTools.getIconFromPackage(ap.getPackageName(), getContext()));
    } else {
        final ResultsAdapterProblemItem ri = (ResultsAdapterProblemItem) getItem(position);
        final SystemProblem sp = ri.getSystemProblem();

        TextView textView = (TextView) rootView.findViewById(R.id.Titlelabel);
        TextView riskText = (TextView) rootView.findViewById(R.id.qualityApp);
        ImageView imageView = (ImageView) rootView.findViewById(R.id.logo);

        if (sp.isDangerous()) {
            riskText.setTextColor(ContextCompat.getColor(getContext(), R.color.HighRiskColor));
            riskText.setText(R.string.high_risk);
        } else {
            riskText.setTextColor(ContextCompat.getColor(getContext(), R.color.MediumRiskColor));
            riskText.setText(R.string.medium_risk);
        }

        RelativeLayout linearLayout = (RelativeLayout) rootView.findViewById(R.id.itemParent);
        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (_onItemChangedStateListener != null)
                    _onItemChangedStateListener.onItemSelected(sp);
            }
        });
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (_onItemChangedStateListener != null)
                    _onItemChangedStateListener.onItemSelected(sp);
            }
        });

        textView.setText(sp.getTitle(getContext()));
        imageView.setImageDrawable(sp.getIcon(getContext()));
    }
}
</code></pre>