重複の可能性:
メソッドコードの65535バイト制限を超える方法
ヒープに64kbを超えるデータがありますが、どうすれば制限を克服できますか?
public class ProductList extends Activity {
//Listview
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");
ArrayList<String> products = new ArrayList<String>();
products.add("Banana" +as+ "Its color is yellow.");
products.add("Orange" +as+ "Orange is a sour fruit.");
products.add("Onion" +as+ "Onion usually used on Pizza");
products.add("Banana" +as+ "Its color is yellow.");
products.add("Orange" +as+ "Orange is a sour fruit.");
products.add("Onion" +as+ "Onion usually used on Pizza");
products.add("Banana" +as+ "Its color is yellow.");
products.add("Orange" +as+ "Orange is a sour fruit.");
products.add("Onion" +as+ "Onion usually used on Pizza");
products.add("Banana" +as+ "Its color is yellow.");
products.add("Orange" +as+ "Orange is a sour fruit.");
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
}
});
}
}
これが問題の画像ですhttps://dl.dropbox.com/u/15065300/problem-4.png
私はAndroidを初めて使用するので、入念な提案が必要です。