• Post Reply Bookmark Topic Watch Topic
  • New Topic

can anyone tell me how pass valueon onclick parameter in android .. i m new to programming ...  RSS feed

 
Mike Hussey
Greenhorn
Posts: 12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
John Joe
Ranch Hand
Posts: 443
3
Android Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To pass value , you probably need Intent
 
Tim Moores
Saloon Keeper
Posts: 4035
94
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think an Intent is the solution, but it's hard to tell because the code contains no onClick method. Which value do you want to pass from where to where?
 
Miri Yusifli
Ranch Hand
Posts: 43
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use OnClickListener and then use intent on this method

 
Mike Hussey
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Want to change the ImageView's picture at runtime dynamically, after 1 sec, 3 sec and 5 sec. but i don't how to pass a vlaue in onClickListener.
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are all sorts of weird and wonderful things about that code; the loop in lines 20‑30 looks very peculiar, almost certainly incorrect.
Why are you calling Thread#sleep? I don't know enough Android, but why can't you use a timer and a timer task object instead?
Why have you got public fields? Why are you using one‑letter indentifiers? Does anybody know what R means?
 
Tim Moores
Saloon Keeper
Posts: 4035
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know what R means?

Actually, anyone doing Android programming does - it's part of the API.
 
Tim Moores
Saloon Keeper
Posts: 4035
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Hussey wrote:Want to change the ImageView's picture at runtime dynamically, after 1 sec, 3 sec and 5 sec. but i don't how to pass a vlaue in onClickListener.

That doesn't answer the question of which value you want to pass from where to where.
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hadn't noticed you are new here. Sorry: welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!