Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Regular Contributor
naveen1989
Posts: 56
Registered: ‎09-14-2011
My Carrier: b.tech
Accepted Solution

Update sample x value

Hi

i am new in blackberry , i want to know how to update value of any integer (example).Please give me sample 

 

code running code so i can applied gud logic.Example

 

I want to update value of x:

 

Please Help 

Please use plain text.
Developer
simon_hain
Posts: 14,082
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Update sample x value

you don't, you create a new Integer.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
naveen1989
Posts: 56
Registered: ‎09-14-2011
My Carrier: b.tech

Re: Update sample x value

Hi

i can't understand..Please sir help with small code..
Please use plain text.
Regular Contributor
naveen1989
Posts: 56
Registered: ‎09-14-2011
My Carrier: b.tech

Re: Update sample x value

actually i want to update from the server .
Please use plain text.
Developer
pradeep_ch
Posts: 540
Registered: ‎12-23-2010
My Carrier: Airtel

Re: Update sample x value

Hi Naveen,

 

I dont know about your requirement, but see this snippet to update the value.

 

public class MyScreen extends MainScreen
{
    private int i = 0;
    private LabelField lblNum;
    
    public MyScreen()
    {
        lblNum = new LabelField(""+i);
        
        ButtonField _btn = new ButtonField("Click Here",ButtonField.CONSUME_CLICK);
        _btn.setChangeListener(new FieldChangeListener() {
            
            public void fieldChanged(Field field, int context) {
                i = i+1;
                lblNum.setText(""+i);
                invalidate();
                
            }
        });
        
        add(lblNum);
        add(_btn);
    }
}

 

Thanks.

Please use plain text.
Regular Contributor
naveen1989
Posts: 56
Registered: ‎09-14-2011
My Carrier: b.tech

Re: Update sample x value

Thanks but i want this value update from server : x can take any value which server not (continuously increasing or decreasing )
Please use plain text.
Developer
pradeep_ch
Posts: 540
Registered: ‎12-23-2010
My Carrier: Airtel

Re: Update sample x value

How you are getting value from server,

Have you established any connection?

 

Please use plain text.
Regular Contributor
naveen1989
Posts: 56
Registered: ‎09-14-2011
My Carrier: b.tech

Re: Update sample x value

Actually i am new in blackberry but,some one ask me this question how to update value from server. i think connection is required ,after that we will take response of server
so i am searching for code.i don't have any url but i am searching for sample code in which update in occurring
Please use plain text.
Developer
peter_strange
Posts: 17,959
Registered: ‎07-14-2008

Re: Update sample x value

Please only ask a question once.  There is no value in having duplicate entries and it bloats the forum,

 

Shall I ask the administrators to remove this duplicate Thread?

http://supportforums.blackberry.com/t5/Java-Development/Update-value-from-the-server/td-p/1778225

Please use plain text.
Regular Contributor
naveen1989
Posts: 56
Registered: ‎09-14-2011
My Carrier: b.tech

Re: Update sample x value

Yes sir i got it answer thanks
Please use plain text.