1

I have a listView and an editText in my RelativeLayout. When I press keyboard the list View scrolls and hides the actionBar. I have searched alot. But none worked. Also the solution in this problem is not working.

Thanks

My Chat Activity

    EditText et = new EditText(this);
    et.setId(111);
    RelativeLayout.LayoutParams lparams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    lparams.addRule(RelativeLayout.CENTER_HORIZONTAL);
    lparams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    lparams.bottomMargin = 5;
    lparams.leftMargin = 5;
    lparams.rightMargin = 5;
    et.setLayoutParams(lparams);
    et.setEms(10);
    et.setImeOptions(EditorInfo.IME_ACTION_SEND);
    et.setInputType(InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
    et.setTextColor(Color.parseColor("#000000"));
    et.setBackgroundColor(Color.parseColor("#FFFFFF"));
    et.getBackground().setAlpha(204);
    rl.addView(et);

    ListView lv = new ListView(this);
    lparams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    lparams.addRule(RelativeLayout.CENTER_HORIZONTAL);
    lparams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
    lparams.addRule(RelativeLayout.ABOVE, et.getId());
    lv.setLayoutParams(lparams);
    lv.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
    lv.setDivider(null);
    lv.setDividerHeight(0);
    lv.setScrollContainer(false);
    rl.addView(lv);
Community
  • 1
  • 1
ZZeyaNN
  • 528
  • 8
  • 13

0 Answers0