Использую бэкэнд в бэкэнлдлесс. У адаптера ListView
есть View
метод, отвечающий за вставку текста в поле
public View getView(int position, View convertView, ViewGroup parent )
{
View view = convertView == null ? mInflater.inflate( mResource, parent, false ) : convertView;
TextView restaurantNameView = (TextView) view.findViewById( R.id.restaurantName );
TextView cuisineView = (TextView) view.findViewById( R.id.restaurantCuisine );
TextView locationsNumberView = (TextView) view.findViewById( R.id.restaurantLocations );
Restaurant item = getItem( position );
restaurantNameView.setText( item.getName() );
cuisineView.setText( item.getCuisine() );
String locationsNumberTextTemplate = getContext().getResources().getQuantityString( R.plurals.restaurant_locations, item.getLocations().size() );
locationsNumberView.setText( String.format( locationsNumberTextTemplate, item.getLocations().size() ) );
return view;
}
из этого кода не могу понять вот эти строки вы бы мне очень помогли
String locationsNumberTextTemplate = getContext().getResources().getQuantityString( R.plurals.restaurant_locations, item.getLocations().size() );
locationsNumberView.setText( String.format( locationsNumberTextTemplate, item.getLocations().size() ) );
если сказали для чего он и с какой целью