Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old November 26th, 2011, 09:33 PM   #1 (permalink)
New Member
 
mineko's Avatar
 
Join Date: Nov 2011
Location: philippines
Posts: 7
 
Device(s): android 3.2
Thanks: 1
Thanked 0 Times in 0 Posts
Laugh Android Dev: Increase value of TextView

I am Computer Engineering student taking up my internship and my boss assigned to me on developing an app for scoreboard. And I am having a hard time for I don't have much background to Java as well as the Android.

Can anyone help me please?

I am developing my program but it seems It really giving me hard time regarding TextView.XD

How do you increase the value of TextView where its value is e.g. is 0?
Just like in Scoreboard. Increasing the value of score as you click the TextView assigned to it.

This is my code:

private OnClickListener mHscoreListener = new OnClickListener() {
public void onClick(View v) {
//DO INCREASE
}; };

Any help would be appreciated. TY!


Arghh hard to self-study lol XD

mineko is offline  
Reply With Quote
Sponsors
Old November 28th, 2011, 06:26 AM   #2 (permalink)
Member
 
Join Date: Dec 2010
Location: Aarhus, Denmark
Posts: 134
 
Device(s): SE Xperia X10
Thanks: 2
Thanked 22 Times in 22 Posts
Default

I would simply make an int variable that counts up on every click and set the textview accordingly. Something like:

Code:
private int count;
private TextView counterText;

public void onCreate(){
...
counterText = findViewById(R.id.your_textview_id);
...
}

...
//DO INCREASE
count++; //Counts up with 1
counterText.setText("" + count);
...
JamTheMan is offline  
Reply With Quote
The Following User Says Thank You to JamTheMan For This Useful Post:
mineko (December 1st, 2011)
Reply

Bookmarks

Tags
android 3.2, java


Go Back   Android Forums > Android Development > Application Development User CP
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 11:50 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo