I don't understand why I got this error!
public static class RoomsArrayAdapter<String> extends ArrayAdapter<String>{
****
private String rmName;
private ArrayList<String> st_list = new ArrayList<String>();
public View getView(int position, View convertView, ViewGroup parent){
View rowView = convertView;
LayoutInflater inflater = (LayoutInflater) raaContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
rowView = inflater.inflate(R.layout.room_layout, parent, false);
rmName = st_list.get(position).toString();
error in rmName = st_list.get(position).toString();
There is my imports:
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.provider.Settings;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.CompletionInfo;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.R.color;
First time I was had error after add onTextChanged method to AutoCompleteTextView in getView() of my ArrayAdapter. I try to restart Eclipse, but it's not help me.
The
public static class RoomsArrayAdapter<String> extends ArrayAdapter<String>{
should read
public static class RoomsArrayAdapter extends ArrayAdapter<String>{
Your current code creates a generic type parameter called String
, which you don't need and whose name clashes with java.lang.String
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With