Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old August 19th, 2012, 08:05 AM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 35
 
Device(s):
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Default change image on click!!

hi all ,
hope all are fine
i want to change image to another image or video by click ??!
anybody know to help plz

Advertisements
wounded is offline  
Reply With Quote
sponsored links
Old August 20th, 2012, 12:06 PM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Code:
 
make your class implement View.OnClickListener, then override the following method as so.
@Override
public void onClick(View v) {
 
    if (v == myButton)
        imageView.setImageResource(R.drawable.my_resource);
}
jonbonazza is offline  
Reply With Quote
Old August 23rd, 2012, 02:53 PM   #3 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 35
 
Device(s):
Carrier: Not Provided

Thanks: 3
Thanked 0 Times in 0 Posts
Default

yeah ,thank you
wounded is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:56 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.