• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Static problem

Hi guys, I am trying to call the setSearch function from UrlBuilder Class, but for some reason I get an error asking me to set my class as static. That's not what I want to do with this class. I know this is a dumb issue, but I would appreciate some help.

[HIGH]package com.KarneeKarnay.gamefinder;

import android.os.Bundle;
import android.app.Activity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.Button;
import com.KarneeKarnay.gamefinder.UrlBuilder;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

UrlBuilder.setSearch("Hal l");
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}
[/HIGH]

[HIGH]package com.KarneeKarnay.gamefinder;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class UrlBuilder {

private String search;

public String setSearch(String query)
{
search = query;

StringBuilder(search);

return search;
}

public void StringBuilder(String string)
{


}


}
[/HIGH]
 
Back
Top Bottom