Attach a button with action to each row of a list

Put your problem here if it does not fit any of the other categories.

Attach a button with action to each row of a list

Postby nonsonoinmatrix » Tue Aug 12, 2008 2:50 pm

Hi, i'm new in the android platform, i've followed the exercises suggested in the google doc and i've did them without problems... Now i want to modify the third exercise:

in the code there is a list of note where is possible to:
- Modify the the inserted notes by the 'onListItemClick' method
- Insert a new not using an action in a menu
- Delete the selected note (the first one) using an action in a menu

Now I want to add a button, one for every single note, and using this button I want to command an action that delete the row selected.
I've already inserted the button, one for each row, changing the notes_row.xml

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <LinearLayout
  5.  
  6.     xmlns:android="http://schemas.android.com/apk/res/android"
  7.  
  8.     android:layout_width="fill_parent"
  9.  
  10.     android:layout_height="wrap_content"
  11.  
  12.     android:orientation="horizontal">
  13.  
  14.         <TextView android:id="@+id/text1"
  15.  
  16.             android:layout_width="wrap_content"
  17.  
  18.             android:textSize="16px"
  19.  
  20.             android:layout_height="40px"/>
  21.  
  22.            
  23.  
  24.         <Button android:id="@+id/delete"
  25.  
  26.           android:text="@string/delete"
  27.  
  28.                 android:layout_width="wrap_content"
  29.  
  30.                 android:layout_height="wrap_content" />
  31.  
  32. </LinearLayout>  
  33.  
  34.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4



My question is.. How can i attach the Action to delete the right row to each button... i Tryed to modify the onCreate() method but without success


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public void onCreate(Bundle icicle) {
  3.  
  4.         super.onCreate(icicle);
  5.  
  6.         setContentView(R.layout.notes_list);
  7.  
  8.         mDbHelper = new NotesDbAdapter(this);
  9.  
  10.         mDbHelper.open();
  11.  
  12.         fillData();
  13.  
  14.      
  15.  
  16.         Cursor c = mDbHelper.fetchAllNotes();
  17.  
  18.         startManagingCursor(c);
  19.  
  20.        
  21.  
  22.         int nameIdRow = c.getColumnIndex(mDbHelper.KEY_ROWID);
  23.  
  24.      
  25.  
  26.         final long temp = this.getSelectedItemId();
  27.  
  28.         Log.d("*** DEBUG ***", "rowId  -  "+temp);
  29.  
  30.        
  31.  
  32.         Button deleteButton = (Button) findViewById(R.id.delete);
  33.  
  34.         deleteButton.setOnClickListener(new View.OnClickListener() {
  35.  
  36.             public void onClick(View view) {
  37.  
  38.                 mDbHelper.deleteNote(temp);
  39.  
  40.                 fillData();
  41.  
  42.                 setResult(RESULT_OK);
  43.  
  44.                 finish();
  45.  
  46.             }    
  47.  
  48.         });
  49.  
  50.     }
  51.  
  52.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4



can anyone help me???

thanks!!!
nonsonoinmatrix
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Aug 11, 2008 2:18 pm

Top

Postby chris » Wed Aug 13, 2008 9:29 am

Hi
First problem with your code

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Button deleteButton = (Button) findViewById(R.id.delete);
  2.  
  3.      deleteButton.setOnClickListener(new View.OnClickListener() {
  4.  
  5.             public void onClick(View view) {
  6.  
  7.                mDbHelper.deleteNote(temp);
  8.  
  9.                 fillData();
  10.  
  11.                setResult(RESULT_OK);
  12.  
  13.                 finish();
  14.  
  15.             }    
  16.  
  17.         });
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


you are only setting a clicklistener to the first button on your list (if you even have one at this time as i'm not sure that during the create the ui of the list will be already inflated.

what you could do :
I don't knwo what type of adapter you are using , but you could use a simplecursorAdapter and use a viewBinder to set your click listener when the list is build. (when the view id is equal to R.id.delete , set the listener)

now , what you are trying to do in your onclicklistener is a bit weird : you remove a note , refresh the data in the list and quit your activity ?

And one last tip , you should use just one Clicklistener for all your buttons to limit memory consumption if they all do the same thing (in fact , i tend to implement the OnClickListener interface in my activity , with a switch on view.id to find out which view has been clicked and what to do and to pass this on the setlistener. This improve the readability of the code and limit then number of class and object i have in my activities.)

Hope this helped


Chris
chris
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Feb 02, 2008 4:39 pm

Postby nonsonoinmatrix » Wed Aug 13, 2008 3:42 pm

Thanks Chris for your respons!!!

my problem is not the adapter... after every action i call the fillData() metod that get from the db all the note and refresh the display with the updated values using the SimpleCursorAdapter

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. private void fillData() {
  3.  
  4.         // Get all of the rows from the database and create the item list
  5.  
  6.         Cursor notesCursor = mDbHelper.fetchAllNotes();
  7.  
  8.         startManagingCursor(notesCursor);
  9.  
  10.        
  11.  
  12.         // Create an array to specify the fields we want to display in the list (only TITLE)
  13.  
  14.         String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
  15.  
  16.        
  17.  
  18.         // and an array of the fields we want to bind those fields to (in this case just text1)
  19.  
  20.         int[] to = new int[]{R.id.text1};
  21.  
  22.        
  23.  
  24.         // Now create a simple cursor adapter and set it to display
  25.  
  26.         SimpleCursorAdapter notes =
  27.  
  28.                     new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
  29.  
  30.         setListAdapter(notes);
  31.  
  32.        
  33.  
  34.        
  35.  
  36.     }
  37.  
  38.  
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


My problem is about to bind the setOnClickListener to the every delete button... I've defined the button on the xml layout descriptor:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4.  
  5.  
  6. <LinearLayout
  7.  
  8.     xmlns:android="http://schemas.android.com/apk/res/android"
  9.  
  10.     android:layout_width="fill_parent"
  11.  
  12.     android:layout_height="wrap_content"
  13.  
  14.     android:orientation="horizontal">
  15.  
  16.         <TextView android:id="@+id/text1"
  17.  
  18.             android:layout_width="wrap_content"
  19.  
  20.             android:textSize="16px"
  21.  
  22.             android:layout_height="40px"/>
  23.  
  24.            
  25.  
  26.         <Button android:id="@+id/delete"
  27.  
  28.           android:text="@string/delete"
  29.  
  30.                 android:layout_width="wrap_content"
  31.  
  32.                 android:layout_height="wrap_content" />
  33.  
  34. </LinearLayout>  
  35.  
  36.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


then, there is a textfield and a button for each row... now... How can I attach the setOnClickListener to every single button and how could I pass the right id to delete the row???

If someone can write me a code snippet to suggest me the right way it will be great!!!

Thanks so much!!!
nonsonoinmatrix
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Aug 11, 2008 2:18 pm

Postby chris » Wed Aug 13, 2008 4:27 pm

all you have to do is to create a ViewBinder and set it to your adapter :

add implements ViewBinder,OnClickListener in your activity
add theses method in your activity (the method from the interfaces we just added (you can use automatic code generation from eclipse:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2.  
  3.  public boolean setViewValue(View view, Cursor cursor, int columnIndex){
  4.  
  5. switch (view.getId()) {
  6.  
  7. case R.id.delete:
  8.  
  9.        view.setOnclickListener(this);
  10.  
  11.        view.setTag(put your row id here from the cursor);//attaching the row id to the view
  12.  
  13.        return true;
  14.  
  15. default:
  16.  
  17. return false;}
  18.  
  19. }
  20.  
  21. @Override
  22.  
  23.  public void onClick(View view, Cursor cursor, int columnIndex){
  24.  
  25. switch (view.getId()) {
  26.  
  27. case R.id.delete:
  28.  
  29.         mDbHelper.deleteNote(view.getTag());
  30.  
  31.                 fillData();
  32.  
  33.                setResult(RESULT_OK);
  34.  
  35.                 finish();
  36.  
  37.  
  38.  
  39.        return ;
  40.  
  41. default:
  42.  
  43. return ;
  44.  
  45. }
  46.  
  47. }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4


and in filldata , add
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. notes.setViewBinder(this);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4

before the setListAdapter
chris
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Feb 02, 2008 4:39 pm

Postby nonsonoinmatrix » Wed Aug 13, 2008 9:43 pm

Hi Chris
I tried but doesn't work yet :( , there are no compiling and neither syntax error, when i push the delete button nothing happens... I post you all the code of the activity, maybe you can see what's wrong..

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. import android.app.ListActivity;
  5.  
  6. import android.content.Intent;
  7.  
  8. import android.database.Cursor;
  9.  
  10. import android.os.Bundle;
  11.  
  12. import android.util.Log;
  13.  
  14. import android.view.Menu;
  15.  
  16. import android.view.View;
  17.  
  18. import android.view.Menu.Item;
  19.  
  20. import android.view.View.OnClickListener;
  21.  
  22. import android.widget.Button;
  23.  
  24. import android.widget.ListView;
  25.  
  26. import android.widget.SimpleCursorAdapter;
  27.  
  28. import android.widget.SimpleCursorAdapter.ViewBinder;
  29.  
  30.  
  31.  
  32. public class Notepadv3 extends ListActivity implements ViewBinder,OnClickListener {
  33.  
  34.     private static final int ACTIVITY_CREATE=0;
  35.  
  36.     private static final int ACTIVITY_EDIT=1;
  37.  
  38.    
  39.  
  40.     private static final int INSERT_ID = Menu.FIRST;
  41.  
  42.     private static final int DELETE_ID = Menu.FIRST + 1;
  43.  
  44.     private static final int DELETEALL_ID = Menu.FIRST + 2;
  45.  
  46.  
  47.  
  48.     private NotesDbAdapter mDbHelper;
  49.  
  50.    
  51.  
  52.    
  53.  
  54.    
  55.  
  56.     /** Called when the activity is first created. */
  57.  
  58.     @Override
  59.  
  60.     public void onCreate(Bundle icicle) {
  61.  
  62.         super.onCreate(icicle);
  63.  
  64.         setContentView(R.layout.notes_list);
  65.  
  66.         mDbHelper = new NotesDbAdapter(this);
  67.  
  68.         mDbHelper.open();
  69.  
  70.         fillData();
  71.  
  72.        
  73.  
  74.     }
  75.  
  76.    
  77.  
  78.     private void fillData() {
  79.  
  80.         // Get all of the rows from the database and create the item list
  81.  
  82.         Cursor notesCursor = mDbHelper.fetchAllNotes();
  83.  
  84.         startManagingCursor(notesCursor);
  85.  
  86.        
  87.  
  88.         // Create an array to specify the fields we want to display in the list (only TITLE)
  89.  
  90.         String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
  91.  
  92.        
  93.  
  94.         // and an array of the fields we want to bind those fields to (in this case just text1)
  95.  
  96.         int[] to = new int[]{R.id.text1};
  97.  
  98.        
  99.  
  100.         // Now create a simple cursor adapter and set it to display
  101.  
  102.         SimpleCursorAdapter notes =
  103.  
  104.                     new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
  105.  
  106.        
  107.  
  108.         notes.setViewBinder(this);
  109.  
  110.         setListAdapter(notes);
  111.  
  112.        
  113.  
  114.        
  115.  
  116.     }
  117.  
  118.    
  119.  
  120.     @Override
  121.  
  122.     public boolean onCreateOptionsMenu(Menu menu) {
  123.  
  124.         super.onCreateOptionsMenu(menu);
  125.  
  126.         menu.add(0, INSERT_ID, R.string.menu_insert);
  127.  
  128.         menu.add(0, DELETE_ID, R.string.menu_delete);
  129.  
  130.         menu.add(0, DELETEALL_ID, R.string.deleteall);
  131.  
  132.         return true;
  133.  
  134.     }
  135.  
  136.  
  137.  
  138.     @Override
  139.  
  140.     public boolean onMenuItemSelected(int featureId, Item item) {
  141.  
  142.         switch(item.getId()) {
  143.  
  144.         case INSERT_ID:
  145.  
  146.             createNote();
  147.  
  148.             return true;
  149.  
  150.         case DELETE_ID:
  151.  
  152.             mDbHelper.deleteNote(getListView().getSelectedItemId());
  153.  
  154.             fillData();
  155.  
  156.             return true;
  157.  
  158.         case DELETEALL_ID:
  159.  
  160.                 Cursor c = mDbHelper.fetchAllNotes();
  161.  
  162.                 int nameIdRow = c.getColumnIndex(mDbHelper.KEY_ROWID);
  163.  
  164.                 c.first();
  165.  
  166.             do {
  167.  
  168.                 long rowId = c.getLong(nameIdRow);
  169.  
  170.                 mDbHelper.deleteNote(rowId);
  171.  
  172.                 fillData();
  173.  
  174.             }while(c.next());
  175.  
  176.         }
  177.  
  178.        
  179.  
  180.         return super.onMenuItemSelected(featureId, item);
  181.  
  182.     }
  183.  
  184.  
  185.  
  186.     private void createNote() {
  187.  
  188.         Intent i = new Intent(this, NoteEdit.class);
  189.  
  190.         startSubActivity(i, ACTIVITY_CREATE);
  191.  
  192.     }
  193.  
  194.    
  195.  
  196.  
  197.  
  198.    
  199.  
  200.     @Override
  201.  
  202.     protected void onListItemClick(ListView l, View v, int position, long id) {
  203.  
  204.         super.onListItemClick(l, v, position, id);
  205.  
  206.         Intent i = new Intent(this, NoteEdit.class);
  207.  
  208.         i.putExtra(NotesDbAdapter.KEY_ROWID, id);
  209.  
  210.         startSubActivity(i, ACTIVITY_EDIT);
  211.  
  212.     }
  213.  
  214.  
  215.  
  216.     @Override
  217.  
  218.     protected void onActivityResult(int requestCode, int resultCode, String data, Bundle extras) {
  219.  
  220.         super.onActivityResult(requestCode, resultCode, data, extras);
  221.  
  222.         fillData();        
  223.  
  224.     }
  225.  
  226.  
  227.  
  228.         @Override
  229.  
  230.         public ListView getListView() {
  231.  
  232.                 return super.getListView();
  233.  
  234.         }
  235.  
  236.  
  237.  
  238.         public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
  239.  
  240.                 Log.d("*** DEBUG ***", "setViewValue:getId  -  "+view.getId());
  241.  
  242.                 Log.d("*** DEBUG ***", "R.id.delete  -  "+R.id.delete);
  243.  
  244.                 switch (view.getId()) {
  245.  
  246.                 case R.id.delete:
  247.  
  248.                        view.setOnClickListener(this);
  249.  
  250.                        int nameIdRow = cursor.getColumnIndex(mDbHelper.KEY_ROWID);
  251.  
  252.                        Log.d("*** DEBUG ***", "nameIdRow -  "+nameIdRow);
  253.  
  254.                        view.setTag(cursor.getLong(nameIdRow));//attaching the row id to the view
  255.  
  256.                        return true;
  257.  
  258.                 default:
  259.  
  260.                 return false;
  261.  
  262.                 }
  263.  
  264.         }
  265.  
  266.  
  267.  
  268.         public void onClick(View v) {
  269.  
  270.                 Log.d("*** DEBUG ***", "onClick:getId  -  "+v.getId()+" - Tag: "+v.getTag());
  271.  
  272.                 switch (v.getId()) {
  273.  
  274.                 case R.id.delete:
  275.  
  276.                         Log.d("*** DEBUG ***", "getTag  -  "+v.getTag());
  277.  
  278.                         mDbHelper.deleteNote(Long.parseLong((String) v.getTag()));
  279.  
  280.                                 fillData();
  281.  
  282.                                setResult(RESULT_OK);
  283.  
  284.                                 finish();
  285.  
  286.                        return ;
  287.  
  288.                 case R.id.text1:
  289.  
  290.                         Intent i = new Intent(this, NoteEdit.class);
  291.  
  292.                 i.putExtra(NotesDbAdapter.KEY_ROWID, Long.parseLong((String) v.getTag()));
  293.  
  294.                 startSubActivity(i, ACTIVITY_EDIT);
  295.  
  296.                 default:
  297.  
  298.                 return ;
  299.  
  300.                 }
  301.  
  302.         }
  303.  
  304.        
  305.  
  306. }
  307.  
  308.  
  309.  
  310.  
Parsed in 0.057 seconds, using GeSHi 1.0.8.4



I think the problem is on the onListItemClick() that intercept the click event before the click() method... but i tried some othere solution but without success...
nonsonoinmatrix
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Aug 11, 2008 2:18 pm

Postby chris » Thu Aug 14, 2008 7:40 am

Hi

Read the doc about the simplecursorAdapter and viewbinder.
It's not working because you did not provide elements in your tables from and to for your button
the easyest for you would be to add
mDbHelper.KEY_ROWID in from and R.id.delete in to
then on setViewValue , you could get the id of the row with
cursor.getLong(columnIndex)

Chris
chris
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Feb 02, 2008 4:39 pm

Top

Postby nonsonoinmatrix » Sat Aug 16, 2008 12:20 pm

Hi..
I've modified the fillData() method adding a simpleCursorAdapter to bind the ROWIDs with the buttons in the follwing way

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. ...
  3.  
  4. String[] from2 = new String[]{NotesDbAdapter.KEY_ROWID};
  5.  
  6. int[] to2 = new int[]{R.id.delete};
  7.  
  8. SimpleCursorAdapter deleteNote =
  9.  
  10.                         new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from2, to2 );
  11.  
  12. deleteNote.setViewBinder(this);
  13.  
  14. ...
  15.  
  16.  
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


then in the setViewValues() method I've get the rowID in the way you said me before:

int nameIdRow = cursor.getColumnIndex(mDbHelper.KEY_ROWID);
view.setTag(cursor.getLong(nameIdRow));

I put lot of Log.d("") to find the problem and I've see that when I push the button, the process never enter in the setViewValue() method and in the onClick() method neither...
I got the problem, it's not able to bind the buttons (defined in the layout of the row) to the action (onClickListener of the single button), but I didn't get what's wrong in that here...

Sorry if I bother you again...and thanks for your help!!!
nonsonoinmatrix
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Aug 11, 2008 2:18 pm

Postby chris » Sat Aug 16, 2008 2:22 pm

Hi
It's normal that you are not enterinyou the setViewValues when you click as this method is called when the screen is building the view for each row of the list not at click time.

if you put a Log with the view id in the setViewValues , in the log , you should see a line for all the ids that you put in the to2 array for each of the rows in your cursor.
from your code , i see that in your log , you should have one line for each row witth the value of R.id.delete.

can you confirm that ?
chris
chris
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Feb 02, 2008 4:39 pm

Postby nonsonoinmatrix » Sat Aug 16, 2008 3:20 pm

Hi Chris.
I've put the log in the setViewValue() but nothing was logged in the LogCat...
that is my method

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
  3.  
  4.                 Log.d("*** DEBUG ***", "setViewValue:getId  -  "+view.getId());
  5.  
  6.                 Log.d("*** DEBUG ***", "R.id.delete  -  "+R.id.delete);
  7.  
  8.                 Log.d("*** DEBUG ***", "KEY_ROWID  -  "+cursor.getColumnIndex(mDbHelper.KEY_ROWID));
  9.  
  10.                 Log.d("*** DEBUG ***", "nameIdRow  -  "+cursor.getLong(cursor.getColumnIndex(mDbHelper.KEY_ROWID)));
  11.  
  12.                 switch (view.getId()) {
  13.  
  14.                 case R.id.delete:
  15.  
  16.                        view.setOnClickListener(this);
  17.  
  18.                        int nameIdRow = cursor.getColumnIndex(mDbHelper.KEY_ROWID);
  19.  
  20.                        Log.d("*** DEBUG ***", "nameIdRow -  "+nameIdRow);
  21.  
  22.                        view.setTag(cursor.getLong(nameIdRow));//attaching the row id to the view
  23.  
  24.                        return true;
  25.  
  26.                 default:
  27.  
  28.                 return false;
  29.  
  30.                 }
  31.  
  32.         }
  33.  
  34.  
Parsed in 0.039 seconds, using GeSHi 1.0.8.4


I've attached so you can have a look if I did something wrong somewhere...
It's freaking me out!!!! :)

thanks a lot!!!
Attachments
Notepadv3.zip
(66.35 KiB) Downloaded 132 times
nonsonoinmatrix
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Aug 11, 2008 2:18 pm

Postby chris » Sun Aug 17, 2008 10:35 am

it's not working because you create 2 adapters and you do not set the right one : here is your code :

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  NotesDbAdapter.KEY_ROWID
  2.  
  3.    int[] to = new int[]{R.id.text1};
  4.  
  5.        
  6.  
  7.         int[] to2 = new int[]{R.id.delete};
  8.  
  9.        
  10.  
  11.         // Now create a simple cursor adapter and set it to display
  12.  
  13.         SimpleCursorAdapter notes =
  14.  
  15.                     new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
  16.  
  17.        
  18.  
  19.         SimpleCursorAdapter deleteNote =
  20.  
  21.                         new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from2, to2 );
  22.  
  23.        
  24.  
  25.        
  26.  
  27.         Log.d("*** DEBUG ***", "I'm in  ");
  28.  
  29.  
  30.  
  31.      
  32.  
  33.         deleteNote.setViewBinder(this);
  34.  
  35.         //setListAdapter(deleteNote);
  36.  
  37.         setListAdapter(notes);
Parsed in 0.038 seconds, using GeSHi 1.0.8.4

and here is what you should do
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.    
  2.  
  3.   String[] from = new String[]{NotesDbAdapter.KEY_TITLE,NotesDbAdapter.KEY_ROWID};
  4.  
  5.        
  6.  
  7.  int[] to = new int[]{R.id.text1,R.id.delete};
  8.  
  9.        
  10.  
  11.         i
  12.  
  13.         // Now create a simple cursor adapter and set it to display
  14.  
  15.         SimpleCursorAdapter notes =
  16.  
  17.                     new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);
  18.  
  19.        
  20.  
  21.      
  22.  
  23.         Log.d("*** DEBUG ***", "I'm in  ");
  24.  
  25.  
  26.  
  27.      
  28.  
  29.         notes.setViewBinder(this);
  30.  
  31.         //setListAdapter(deleteNote);
  32.  
  33.         setListAdapter(notes);
Parsed in 0.037 seconds, using GeSHi 1.0.8.4
chris
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Feb 02, 2008 4:39 pm

Postby nonsonoinmatrix » Sun Aug 17, 2008 12:29 pm

I get to the point now!!! Problem solved...

finally the delete button works fine...

Thanks a lot!!! You where so helpfull!
nonsonoinmatrix
Junior Developer
Junior Developer
 
Posts: 10
Joined: Mon Aug 11, 2008 2:18 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 10 guests