I want to strike specific text in Spinner, My code look like below code
packSpinner = findViewById(R.id.packSpinner);
String spinnerArray[] = new String[10];
for(int i=0; i<8; i++){
spinnerArray[i] = packArray[i] + mrpArray[i] + sellingPriceArray[i];
}
packSpinner.setAdapter(new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_1, spinnerArray));
In above code products coming from server and i already extracted that data into packArray, mrpArray and sellingPriceArray, now i want to mrp text should be striked.
you can use
StrikethroughSpanor just settextView.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);but for both you must have access toTextView, so you can't achieve your purposes with defautArrayAdapter, it was designed to show simple lists without custom effects (most common usage). you have to extend it and overridegetViewmethod. some examples HERE, HERE and HERE