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.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 40
Registered: ‎07-20-2010
My Device: Not Specified
Accepted Solution

simple problem

Hey,

 

this should be a simple problem but i still can't get it to work.

 

i have a class. i've attached a bit of the code.

 

public class HttpRequestDispatcher extends Thread
{
    private String url;
    private String method;
    private NetworkingMainScreen screen;
    
    
    public HttpRequestDispatcher()
    {
        this.url=url;
        this.method=method;
        this.screen=screen;
    }
    public void run()

 

 

i'm trying to pass the value of the url to this class from the main class using -

 

    private void getURL()
    {
        HttpRequestDispatcher dispatcher = new HttpRequestDispatcher(urlField.getText(),"GET",this);
        dispatcher.start(); //urlField.getText(), "GET", this
    }

 

this gives an error and it should as the class HttpRequestDispatcher does not acceptany parameters. but how do i solve the problem

 

thanks a lot

Developer
Posts: 176
Registered: ‎11-06-2008
My Device: Not Specified

Re: simple problem

How about the fact that you have no parameters in the constructor

Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: simple problem

public HttpRequestDispatcher(String url, String method, NetworkingMainScreen screen)
    {
        this.url=url;
        this.method=method;
        this.screen=screen;
    }

 

Do like this , u didnt used formal arguments in the constructor

Developer
Posts: 40
Registered: ‎07-20-2010
My Device: Not Specified

Re: simple problem

thanks a lot.. it worked

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: simple problem

When u acll ur Thread class then U r passing three parameter,

But in the thread class constracter U r not using parameter.

 

now what is this. Errror must Come.

 

Look at the swati example, This is right.