제품 목록이 있지만 Java가 메소드가 65535 바이트의 한계를 초과한다고 Java가 불평합니다. 어떻게하면 더 많은 단어를 추가하고 한계를 극복 할 수 있습니까? 쉽게 이해하기 위해서메소드 코드에 대해 65535 바이트 제한을 초과하는 방법
public class ProductList extends Activity {
// List view
private ListView lv;
// Listview Adapter
ArrayAdapter<String> adapter;
// Search EditText
EditText inputSearch;
// ArrayList for Listview
ArrayList<HashMap<String, String>> productList;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_list);
String as = System.getProperty("line.separator");
String products[] = {
// I want these words to keep in a database
// Because here is 65kb limit but I need more...
"Banana" +as+ "Its color is yellow." ,
"Orange" +as+ "Orange is a sour fruit." ,
"Onion" +as+ "Onion usually used on Pizza" ,
"Google" +as+ "Google is a giant search engine." ,
"Love" +as+ "Love is related to heart." ,
"Lily" +as+ "It is one kind of white flower." ,
"Banana" +as+ "Its color is yellow." ,
"Orange" +as+ "Orange is a sour fruit." ,
"Onion" +as+ "Onion usually used on Pizza" ,
"Google" +as+ "Google is a giant search engine." ,
"Love" +as+ "Love is related to heart." ,
"Lily" +as+ "It is one kind of white flower." ,
"Banana" +as+ "Its color is yellow." ,
"Orange" +as+ "Orange is a sour fruit." ,
"Onion" +as+ "Onion usually used on Pizza" ,
"Google" +as+ "Google is a giant search engine." ,
};
lv = (ListView) findViewById(R.id.list_view);
inputSearch = (EditText) findViewById(R.id.inputSearch);
// Adding items to listview
adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.p_list, products);
lv.setAdapter(adapter);
/**
* Enabling Search Filter
* */
inputSearch.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
// When user changed the Text
ProductList.this.adapter.getFilter().filter(cs);
}
@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub
}
});
}
}
: 사전에
덕분에
파일에서 데이터를 읽습니다. – dmon