I'm trying to do an "Unselect all" button in a ListActivity to unchecked all checkboxes in a ListView managed by a custom SimpleCursorAdapter.
As suggested here, I tried
In my ListActivity I have:
Button bt_f_unsel = (Button) findViewById(R.id.btn_f_unsel);
bt_f_unsel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
for ( int i=0; i< getListAdapter().getCount(); i++ ) {
mListView.setItemChecked(i, false);
}
}
});
but nothing happens.
I'm wondering if this is because of my custom row:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/contact_pic"
android:layout_width="50dp"
android:layout_height="50dp" />
<TextView
android:id="#+id/contact_name"
android:textSize="10sp"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="#+id/checkbox"
android:button="#drawable/whipem_cb"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
which makes mListView.setItemChecked() not find the checkbox.
How can I uncheck all cb and refresh all the rows from a button in my ListActivity?
Thanks
I'm using a dirty but easy trick:
//recursive blind checks removal for everything inside a View
private void removeAllChecks(ViewGroup vg) {
View v = null;
for(int i = 0; i < vg.getChildCount(); i++){
try {
v = vg.getChildAt(i);
((CheckBox)v).setChecked(false);
}
catch(Exception e1){ //if not checkBox, null View, etc
try {
removeAllChecks((ViewGroup)v);
}
catch(Exception e2){ //v is not a view group
continue;
}
}
}
}
Pass your list object to it. Just avoid really long and complicated lists.
Honestly I don't think the setChecked Methods will work with a custom layout. It expects the view to be a CheckedTextView with an id of text1.
And since the views are recycled I think the solution is to update whatever boolean in your objects in the list that determines if the checkbox is checked and then call adapter.notifyDataSetChanged(). You are changing the boolean state of the data (which is what really matters) and telling the Adapter to update the ListView. So the next time the views are drawn the checkbox will be checked correctly. And the current views that are shown will be redrawn.
This worked for me:
MenuViewAdapter adapter = new MenuViewAdapter(this, menuViews,this);
ListView lv = (ListView)this.findViewById(R.id.menu_list);
CheckBox cb;
for(int i=0; i<lv.getChildCount();i++)
{
cb = (CheckBox)lv.getChildAt(i).findViewById(R.id.checkBox);
cb.setChecked(false);
}
adapter.notifyDataSetChanged();
I use
checkbox.setChecked(false);
checkbox.refreshDrawableState();
Related
I'm building an Android application using ListView. I have list view items as show below.
^ List Item Index 0
^ List Item Index 1
The xlm is as follows.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="4dip" >
<ImageView
android:id="#+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="#drawable/icon" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="0.93"
android:orientation="vertical"
android:padding="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<!-- JFN bottom used to be 2, top 6 -->
<!-- Name Label -->
<TextView
android:id="#+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="0dip"
android:paddingTop="0dip"
android:textColor="#43bd00"
android:textSize="16sp"
android:textStyle="bold" />
<!-- Email label -->
<TextView
android:id="#+id/email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="0dip"
android:textColor="#acacac" />
<!-- Mobile number label -->
<TextView
android:id="#+id/mobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:text="Mobile: "
android:textColor="#5d5d5d"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical" >
<ImageView
android:id="#+id/chat"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="2dip"
android:gravity="right"
android:src="#drawable/chat" />
<ImageView
android:id="#+id/calendar"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="2dip"
android:gravity="right"
android:src="#drawable/calendar" />
</LinearLayout>
</LinearLayout>
I'm trying to detect four different click events:
When the picture of the dog is clicked
When the middle section is clicked
When the chat button is clicked
When the calendar button is clicked
In addition, each of these clicks must be distinguishable based on which item in the ListView has been clicked.
I know how I can tell each ListItem apart: I can use the ListView.setOnItemClickListener as is shown below, which provides an id of the item in the list. But this does not tell me which of the four portions was clicked on.
ListView lv = getListView();
// Listview on item click listener
lv.setOnItemClickListener(new OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// getting values from selected ListItem
Log.d("JFN","List item clicked with id: "+id);
}
});
I can also bind a different onClick function call to each of the four sections in the xml, but this doesn't let me know which of the list items was clicked.
android:onClick="imgClicked"
I don't think I can combine these two solutions, as it would introduce a race condition. Is there a proper way to accomplish detecting both which list item was clicked, and which part of that particular list item was clicked?
Further Info
The following code shows my creation of the ListView using the adapter.
// Retrieve string, convert to JSON, and extract contacts
String jsonData = jsonToStringFromAssetFolder("maemployees.json",this);
JSONObject jsonObj = new JSONObject(jsonData).getJSONObject(TAG_RESULTS);
int numContacts = jsonObj.getInt(TAG_NUM);
Log.d("JFN","Number of contacts stated: "+numContacts);
contacts = jsonObj.getJSONArray(TAG_CONTACTS);
Log.d("JFN","Number of contacts present: "+contacts.length());
// Loop over contacts
for( int i=0; i<contacts.length(); i++) {
// Extract this one
JSONObject c = contacts.getJSONObject(i);
// Extract strings
String first = (c.has(TAG_FIRST)) ? c.getString(TAG_FIRST) : "";
String last = (c.has(TAG_LAST)) ? c.getString(TAG_LAST) : "";
String city = (c.has(TAG_CITY)) ? c.getString(TAG_CITY) : "";
String state = (c.has(TAG_STATE)) ? c.getString(TAG_STATE) : "";
String country = (c.has(TAG_COUNTRY)) ? c.getString(TAG_COUNTRY) : "";
String costName = (c.has(TAG_COST_NAME)) ? c.getString(TAG_COST_NAME) : "";
// Temporary hash map for single contact
HashMap<String, String> contact = new HashMap<String, String>();
contact.put("name", first+" "+last);
contact.put("email", city+", "+state+", "+country);
contact.put("mobile", costName);
// Adding single contact to list
contactList.add(contact);
}
Log.d("JFN","Done looping contacts");
//Updating parsed JSON data into ListView
ListAdapter adapter = new SimpleAdapter(
MainActivity.this, contactList,
R.layout.list_item, new String[] { "name", "email",
"mobile" }, new int[] { R.id.name,
R.id.email, R.id.mobile });
setListAdapter(adapter);
Allright I was having a similar kind of problem but i was using a ViewPager with a ListFragment and a custom ListView Layout.
In the above case you are using just ImageViews, but just in case if you use controls like ImageButton, CheckBox ,Button etc then you would face problems discussed here and here.
This is simply because such controls can steal focus from the ListView and the complete list item cant be selected/clicked. so I would say that just using ImageViews is a smart move.
I am assuming that you are using an Adapter to set the content of your list. Inside that adapter you can assign onClickListener()s for each item like this:
public class MyListAdapter extends ArrayAdapter<String>{
.......
#Override
public View getView(int position, View convertView, ViewGroup parent) {
View rowView=inflator.inflate(R.layout.channel_list_item, null, true);
ImageView chat=(ImageView) rowView.findViewById(R.id.chat);
chat.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
//do something
}
}
ImageView calendar=(ImageView) rowView.findViewById(R.id.calendar);
calendar.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
//do something
}
}
.......
}
}
but remember that while using controls like ImageButton, CheckBox ,Button you need to assign property android:focusable="false" in the XML. and for the ImageButton you need to do this inside the getView() method:
final ImageButton imgBtn=(ImageButton) rowView.findViewById(R.id.imgBtn);
imgBtn.setFocusable(false);
imgBtn.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
//do your task here
}
});
or you can also use Nathaniel Waggoner's approach.
Hope I answered your question.
You must be setting the content of your list view in an Adapter, So inside the adapter, there is a method getView(). Inside that getView() define each of your view and then set onCLickListener inside those view.
For Ex:
dog.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
//operation to be performed.
}
});
similarly apply onCLickListeners() to all other views.
If you don't want to set on click listeners for each item, the other option is to compare the view.getId() value of the view passed into on click, to the ids of the views, something like:
switch(view.getId()){
case(R.id.dog_image):
//do stuff
break;
case(R.id.other_image):
//do stuff
break;
}
Otherwise you can do this programatically by doing the following in onCreate:
.....
setContentView(myView);
ImageView dogImage = (ImageView) findViewById(R.id.dog_image);
dogImage.setOnClickListener(new View.OnClickListener {
#Override
public void onClick(View v) {
// do stuff...
}
})
....
I am using customize ListView in which there is a Spinner.
Code:-
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/lightGray2"
android:shrinkColumns="*"
android:stretchColumns="*" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Spinner
android:id="#+id/spinnerPaymentType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="17" />
<EditText
android:id="#+id/eTextPaymentAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="7"
android:inputType="number" />
<Button
android:id="#+id/btnPaymentDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="6" />
</TableRow>
</TableLayout>
There is a button(Suppose buttonA) which is out side ListView and after clicking on this button one row get added in ListView.
Now I want to disable all other row spinner when I click on the buttonA.
Suppose already three row was there and before adding fourth row in ListView I want to disable spinner which is inside first three row.
Adapter getView Code:-
#Override
public View getView(int position, View convertView, ViewGroup parent) {
System.out.println("*** getView() ***");
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(rowResourceId, parent, false);
Spinner spinnerPaymentType = (Spinner) rowView
.findViewById(R.id.spinnerPaymentType);
EditText eTextPaymentAmount = (EditText) rowView
.findViewById(R.id.eTextPaymentAmount);
eTextPaymentAmount.setText(String.valueOf(position));
btnPaymentDetail = (Button) rowView.findViewById(R.id.btnPaymentDetail);
btnPaymentDetail.setTag(position);
btnPaymentDetail.setOnLongClickListener(this);
btnPaymentDetail.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
System.out.println("*** btnPaymentDetail is clicked");
getPaymentDetail();
}
});
ArrayList<PaymentType> aListpaymentTypes = new ArrayList<PaymentType>();
for (int i = 0; i < paymentCollection.get(0).getaListPaymentOptions()
.size(); i++) {
aListpaymentTypes.add(new PaymentType(paymentCollection.get(0)
.getaListPaymentOptions().get(i).getIntPaymentId(),
paymentCollection.get(0).getaListPaymentOptions().get(i)
.getStrPaymentType()));
}
ArrayAdapter<PaymentType> aAdapterPaymentType = new ArrayAdapter<PaymentType>(
context, android.R.layout.simple_spinner_item,
aListpaymentTypes);
aAdapterPaymentType
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerPaymentType.setAdapter(aAdapterPaymentType);
spinnerPaymentType.setOnItemSelectedListener(this);
return rowView;
}
I presume you are expanding this layout in the getView() method of an ArrayAdapter. In this method, you can check whether the current list item is the last one and if it isn't, disable the spinner. When you add a new item, invalidate the ArrayAdapter so that the list is redrawn.
UPDATE
Try adding this line before returning rowView:
//if spinner is last spinner, enable. Otherwise disbale.
spinnerPaymentType.setEnabled( (position == this.getCount()-1) );
please refer this image https://www.dropbox.com/s/6zoj9lw10oc07xa/to_dropbox.png
what i am doing :
i am creating a list_view , in which i am adding custom adapter .
what i am using :
i am using , listView , customAdapter , menuitem .
listView : single listview in whole application
customadapters : 3 custom adapters
menuitem : 1
How i am implementing :
i have data base from which things are fetched properly , and from that database i have entered these values in my listview by filtering that data in 3 types :
1st adapter_type is entered by default ( in onCreate ) .
adapter = new Adapter_forCompletedReminder( array_today_title , this) ;
ls.setAdapter(adapter) ;
2nd adapter_type is entered in my listview by pressing menuitem .
adapter = new Adapter_forCompletedReminder( array_past_2_day_title , this) ;
ls.setAdapter(adapter) ;
3rd adapter_type is entered in my listview by pressing menuitem .
adapter = new Adapter_forCompletedReminder( array_other_day_title , this) ;
ls.setAdapter(adapter) ;
what is my problem :
this code is added inside onCreate() method .
ls.setOnItemClickListener( new AdapterView.OnItemClickListener()
{
public void onItemClick(AdapterView<?> adapterView , View view , int position ,long arg3)
{
Log.i("Item clicked","tushar:itemclicked") ;
}
});
when i have tried to implement AdapterView.OnItemClickListener() , it is not working ...
code is not crashing ( no red lines in log cat ).
code is not executing in the click of llist_view_element
thanks , for reading my problem .
You use checkbox in customview_completedxml_listview.xml that is why onItemClick listener is not working. If you set clickable = "false" in checkbox then onItemclick listener will work.
If you want want that checkbox will stil work then you have to set onclicklistener event in you custom adapter class.
// I edit getView
#Override
public View getView(int position, View convertView, ViewGroup parent)
{
LayoutInflater inflater = LayoutInflater.from(ob) ;
View v = inflater.inflate(R.layout.customview_completedxml_listview, null ) ;
TextView txt = ( TextView ) v.findViewById(R.id.txt_fordisplayingdata) ;
txt.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Toast.makeText(ob, "Hello", Toast.LENGTH_SHORT).show();
}
});
txt.setText(recieved_Array[position]) ;
return v ;
}
///////////////////////
// Second solution set android:focusable="false" in checkbox
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
>
<TextView
android:id="#+id/txt_fordisplayingdata"
android:layout_width="240dp"
android:text="display data"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
/>
<TextView
android:id="#+id/txt_fordisplayingLargerdata"
android:layout_width="240dp"
android:text="display data larger bahut larger "
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:visibility="gone"
/>
<View
android:layout_width="2dp"
android:layout_toRightOf="#id/txt_fordisplayingdata"
android:layout_height="15dp"
android:layout_marginLeft="15dp"
android:layout_centerVertical="true"
android:id="#+id/view_forcompletedtask"
/>
<CheckBox
android:layout_toRightOf="#id/view_forcompletedtask"
android:id="#+id/checkbox_tocomplete"
android:layout_marginLeft="15dp"
android:layout_width="wrap_content"
android:focusable="false"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
/>
</RelativeLayout>
Here are few things you can try :-
If there is any button(or checkbox) or any element in your listview item which handles click event then do this for each element:-
android:focusable = "false"
android:focusableInTouchMode = "false"
Try setting this
list.setItemsCanFocus(false);
Override the onItemClick() method
ls.setOnItemClickListener( new AdapterView.OnItemClickListener()
{
#Override
public void onItemClick(AdapterView<?> adapterView , View view , int position ,long arg3)
{
Log.i("Item clicked","tushar:itemclicked") ;
}
});
I really can't say what exactly problem you have, but I wrote very simple example for you. Try it, and if it works - just port your current project into my sample project. https://docs.google.com/file/d/0Bz4Xd7Ju_kbYbVlyd1dvYTJZYTg/edit?usp=sharingalways
P.S.: I recommend you to read about "best practices in Android", when you finish your idea ( about ViewHolder pattern).
I'm having a problem with OnItemClickListener on a ListView, the OnItemClick overridden method is not triggered... Here's my code:
public void popupCatCategories(){
LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);
View popupCatCategoriesView = layoutInflater.inflate(R.layout.popup_cats_categories, null);
final PopupWindow popupWindow = new PopupWindow(popupCatCategoriesView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
Button btnDismiss = (Button) popupCatCategoriesView.findViewById(R.id.dismiss);
btnDismiss.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v) {
// TODO Auto-generated method stub
popupWindow.dismiss();
}
});
// listview to display image and text
ListView listCatCategories = (ListView) popupCatCategoriesView.findViewById(R.id.listCatCategories);
List<HashMap<String, String>> listCategories = new ArrayList<HashMap<String, String>>();
db.open();
Cursor catCategories = db.getAllCatCategoryList();
if (catCategories.moveToFirst())
{
do {
HashMap<String, String> hm = new HashMap<String, String>();
hm.put("catCategoryThumbnail", Integer.toString(catCategories.getInt(1)));
hm.put("catName", catCategories.getString(0));
listCategories.add(hm);
} while (catCategories.moveToNext());
}
db.close();
listCatCategories.setAdapter(new ItemListBaseAdapter(getApplicationContext(), listCategories));
Log.i("got it?", "wait for it...");
listCatCategories.setOnItemClickListener(new OnItemClickListener() {
#Override
public void onItemClick(AdapterView<?> a, View view, int position, long id) {
Log.i("got it?", "yea, got it!");
Toast.makeText(getBaseContext(), "got it", Toast.LENGTH_SHORT).show();
}
});
popupWindow.showAsDropDown(btnCats, 50, -330);
}
I'm simply adding some values in an ArrayList of HashMap, each HashMap contains 2 String variables, which are displayed in each row of the ListView. There is only an ImageView and a TextView inside a RelativeLayout for the custom xml layout of the ListView. It displayed fine, except that then I click on a row, nothing happens, it does not trigger the Log or anything. The Overridden method onItemClick is not triggered at all.
I've already tried to setClickable(true) or setItemsCanFocus(false) on the ListView, or setFocusable(false) and setFocusableInTouchMode(false) on the ImageView and TextView (even though its applicable for Checkboxes and Buttons right?).
Here's the custom xml for the ListView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="#+id/catCategoryThumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" />
<TextView
android:id="#+id/txtCatCategoryName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15dp"
android:focusable="false"
android:focusableInTouchMode="false" />
</RelativeLayout>
Anyway, I don't know what to do anymore, can anyone please help me?
If you need anymore information, please let me know. Thanks
The reason your view isn't accepting the event is because the TextView (which is focusable) is overriding it and taking all touch/click action for itself.
You just have to set these for the TextView:
android:focusable="false"
android:focusableInTouchMode="false"
Found an alternate solution: https://stackoverflow.com/a/6579192/1759005. It's working just as fine.
I've done a Custom Listview with 3 columns:
Product / Selected (check box)/ Quantity.
The first column i've get from sqllite database. And second and third column, i'll write into a database.
I've the problem that when i write into qunatity column the checkbox i've checked is unchecked, and it doesn't work.
Another problem is when select edittext to write a quantity the checkbox selections changes.
//productos.java
Button btComanda = (Button) findViewById(R.id.btComanda);
btComanda.setOnClickListener(new OnClickListener() {
public void onClick (View arg0) {
Log.v("Escriu Comanda", "inici");
final ListView prodSpinner = (ListView) findViewById(R.id.list);
final CheckBox cbArticle = (CheckBox) findViewById(R.id.TextView02);
final TextView txtQuantitat = (TextView) findViewById(R.id.TextView03);
int count = 0;
Log.v("Escriu Comanda 2",String.valueOf(prodCursor.getCount())+ " " + txtQuantitat);
for(int i = 0; i < prodCursor.getCount(); i++)
{
Log.v("inserta 1", String.valueOf(Producte)+ " " + cbArticle.isChecked());
Producte = i;
String a = prodSpinner.getItemAtPosition(i).toString();
InsertaComanda();
});
recCatSpinner();
}
public void recProdSpinner() {
ListView prodSpinner = (ListView) findViewById(R.id.list);
prodCursor = recuperaProductos();
prodSpinner.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
prodAdapter = new ArrayAdapter<String>(this, R.layout.listview, R.id.TextView02);
prodAdapter.setDropDownViewResource (R.layout.listview_item_row);
prodSpinner.setAdapter(prodAdapter);
if (prodCursor.moveToFirst()) {
do {
prodAdapter.add(prodCursor.getString(1));
}
while (prodCursor.moveToNext());
if (db != null) {
db.close();
}
}
startManagingCursor(prodCursor);
prodCursor.close();
prodSpinner.setOnItemClickListener(
new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent,
View view, int pos, long id) {
}
});
}
The xml file:
<TableLayout
android:id="#+id/tableLayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="10.77" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
</TextView>
<CheckBox
android:id="#+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#+id/TextView02"
android:focusable="false" />
<EditText
android:id="#+id/TextView03"
android:layout_width="138dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</TableRow>
</TableLayout>
</LinearLayout>
Read about how ListViews work and you will understand why its happening - the ListView is populating each row when it appears on the screen (so your values and states will change when you scroll)
so what you need to do is to save the state at the moment the user is changing it to somewhere safe - array / database etc.. and when you load it under your custom list adapter you need to change the state into the right one
so for your checkboxs you need to implement a listener and save its state when it is changing and under getView you need to set the specific CheckBox to its saved state .
the thing is EditTexts inside ListViews is pretty damn problematic but it is possible if you are stubborn enough.
hope it helps and tell me if you need any more help.
in addition to
android:focusable="false"
add this also..
"android:clickable="false""
i think it works.. let me know if it doesn't..