title: How to assign value to each item in listView?
body: <p>I am working on health related app. In <code>ListView</code> I want to assign value to each item. For example <code>milk</code> contains <code>21 calories</code> so I want to assign <code>21</code> to <code>ListView</code> item <code>milk</code>. </p>
  
  <p>Here is my activity code containing <code>ListView</code>.</p>
  
  <pre><code>public class FoodEntry extends AppCompatActivity {
  
  // Array of strings...
  String[] food = {"Naan","Pav bhaji","chole tikiya", "rice", "soybean", "milk", "curd"};
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_food_entry);
  
      ArrayAdapter adapter = new ArrayAdapter&lt;&gt;(this, R.layout.activity_item, food);
      ListView listViewFoodItems = (ListView)findViewById(R.id.listViewFood);
      listViewFoodItems.setAdapter(adapter);
  }
  }
  </code></pre>