Help coderanch get a
new server
by contributing to the fundraiser

Jarrek Smith

+ Follow
since Oct 18, 2010
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jarrek Smith

VideoView video = (VideoView) findViewById(;
Uri uri = Uri.parse("android.resource://org.yourpackage/"+R.raw.videonamewithoutextension);
MediaController mc = new MediaController(this);
video .setMediaController(mc);
video .setVideoURI(uri);
video .start();
13 years ago
You should use setVisibility

With the parameter 8 : Gone
Using Gone make the layout invisible and make it taking no space in the parent layout
13 years ago
In get View you bind the layout element to the ViewHolder propertie.

for example : in your viewHolder you have
ImageView img1

in get view you bind the image of the layout to img1

for example : img1= (ImageView) convertView.findViewById(

then you add an onclick listener in img1

img1.setOnClickListener(new OnClickListener() { ...

that should do the trick.
Setting an on click listener on the gridView isn't precise enought.
You have to set an on click Listener on the view contained in your grid view

13 years ago
Step 1 : in the item (for example itemTwoLine) you use to create a list (for example mList)of item that you are passing to the adapter you add a field of type boolean ( for example cb1 ), in the item you add getter and setter for this property.

code of itemTwoLine :

Step 2 : in the adapter you add an on click listener on the checkbox of your layout :

step 3 : you populate a list of item and pass it to the adapter

and here are the code of the layout

item_two_line.xml :



this sample code will provide you a list of item which contains an image, two line of text and a checkBox.
To retrieve state of checkboxs you can iterate to mListe in your mainActivity on the field cb1 with getCb1.
Then you will get for each line of mListe the state of the checkBox

hope this help

13 years ago
Have you try requesting a new cursor after the delete?
like myCursor = dbhelper.getContact()
13 years ago