Send and Receive Message not display in listview

  • Replies:1
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Aug 5, 2015 8:01:22 AM via Website

I develop sms app using smsManager. I send and receive sms successfully but send and receive message not display in listview. I use listview adapter for display message in listview but nothing. Listview custom adapter code below:

public class MyCustomAdapter extends ArrayAdapter<String> {

    public MyCustomAdapter(Context context, int textViewResourceId,
            final String wordslist) {
        super(context, textViewResourceId);


    TextView txt_worditem;

    @SuppressLint("ViewHolder") @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;
        try {
            LayoutInflater inflater = getLayoutInflater();
            row = inflater.inflate(R.layout.worditem, parent, false);
            txt_worditem = (TextView) row
                            // txt_worditem.setBackgroundColor(55 + AppSettings.bck_color);
        } catch (Exception e) {
            Toast.makeText(Main.this, e.toString(), Toast.LENGTH_LONG)

        return row;

Custom adapter set in on Create method:

MyCustomAdapter mdp = new MyCustomAdapter(getApplicationContext(),R.layout.worditem, wordslist); 

Everything fine in code no error occurred but send and receive message not display in listview. Please help me for displaying message in listview

  • Forum posts: 207

Sep 15, 2015 8:00:45 AM via Website

did you check the wordslist size ???? also your layout.

try for once to check whether code is working or not.

MyCustomAdapter mdp = new MyCustomAdapter(getApplicationContext(),android.R.layout.simple_list_item, wordslist);

before check if wordlist.size()>0 than set adapter else Toast for no messages are avaliable.