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

Reply
Developer
ashish117
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

Please use plain text.
Developer
jhw1701
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

Please use plain text.
Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm

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

Please use plain text.
Developer
ashish117
Posts: 40
Registered: ‎07-20-2010
My Device: Not Specified

Re: simple problem

thanks a lot.. it worked

Please use plain text.
Developer
nitinverma274
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.

Please use plain text.