- Forum posts: 1
Aug 5, 2015, 8:01:22 AM via Website
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
.findViewById(R.id.main_txt_worditem);
//txt_worditem.setText(wordslist.get(position));
// txt_worditem.setBackgroundColor(55 + AppSettings.bck_color);
} catch (Exception e) {
Toast.makeText(Main.this, e.toString(), Toast.LENGTH_LONG)
.show();
}
return row;
}
}
Custom adapter set in on Create method:
MyCustomAdapter mdp = new MyCustomAdapter(getApplicationContext(),R.layout.worditem, wordslist);
lv.setAdapter(mdp);
lv.setVisibility(View.VISIBLE);
Everything fine in code no error occurred but send and receive message not display in listview. Please help me for displaying message in listview
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.