Wednesday, 21 May 2014

ListView with checkbox

ListView with checkbox


1)Create a new android application project in eclipse 

2)Then after craeting a new project you have to edit the activity_mail.xml file , As shown below

3)After editing the activity_main.xml file now you have to code the main activity  file as shown below
Main Activity

package com.mobileapptech.listcheck;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends ActionBarActivity {

String[] country = new String[] {
   protected void onCreate(Bundle savedInstanceState) {
       ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice, country);
       ListView listView = (ListView) findViewById(;

 4)Now the ListView with checkbox  is ready



Post a Comment

Total Pageviews

Contact Form


Email *

Message *