I will explain what i done in my alertBox i Inflate a View for the alertBox its name is view. and in that view a LinearLayout is there its name is 'main layout' i inflate another view which contains a radioGroups and editTexts. its name is layout. i add the 2nd view(layout) to the first view (view). and when i click on the radioButtons its work properly. but when i click on the editText it doesn't open the softKeyboard –</p>
i open an alertBox which inflate a view. but it doesn't show a the soft keyboard when i click on the EditText in the alertBox.
Builder alertCreate = new AlertDialog.Builder(parent);
alertCreate.setTitle("New Schedule");
inflater = LayoutInflater.from(parent);
View view = inflater.inflate(R.layout.activity_schedule, null);
spinnerRepeat = (Spinner)view.findViewById(R.id.spinner_schedule_repeat);
spinnerRepeat.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
LinearLayout mainLayout= (LinearLayout)view.findViewById(R.id.main_Layout);
LinearLayout spinnerLayout = (LinearLayout)view.findViewById(R.id.spinner_Layout);
View weeklyLayout = inflater.inflate(R.layout.schedule_week_selection, null);
initializeWeeks(weeklyLayout);
if(arg2>0)
{
if(flag==0)
{
View layout = inflater.inflate(R.layout.schedule_ends_on, null);
RelativeLayout layout2 =(RelativeLayout)layout.findViewById(R.id.endsOn_layout);
rgEndsOn =(RadioGroup)layout.findViewById(R.id.radioGroup_endsOn);
radio_occr=(RadioButton)layout.findViewById(R.id.radio_schedule_occr);
radio_date=(RadioButton)layout.findViewById(R.id.radio_schedule_date);
occurence=(TextView)layout.findViewById(R.id.tv_schedule_Occur);
addCheckListenerToRgEndsOn();
etEndsOn=(EditText)layout.findViewById(R.id.Et_schedule_occur);
etEndDate=(EditText)layout.findViewById(R.id.et_schedule_enddate);
etEndDate.setClickable(true);
etEndDate.setText(formatDate(TimeFormater.DateToString(startDate)));
mainLayout.addView(layout, 3);
flag=1;
}
if(arg2==2)
{
spinnerLayout.addView(weeklyLayout,2);
}
else
{
View v = (View)spinnerLayout.getChildAt(2);
spinnerLayout.removeView(v);
}
}
else
{
Log.e("id",""+mainLayout.getChildAt(3));
View v = (View)mainLayout.getChildAt(3);
View v2 = (View)spinnerLayout.getChildAt(2);
spinnerLayout.removeView(v2);
mainLayout.removeView(v);
flag=0;
}
}
but when i click on the EditText (etEndsOn) it doesn't pop up the keyboard