0
Я не знаю, почему youtue_title и youtube_description null? после добавления текста в этот editText ??? Я делаю это все время, почему теперь это не работает? ??EditText.getText в диалоговом окне всплывающего окна
Есть проблема, потому что она находится в popup window?
public void popup_win_with_layout(){
//select video to upload youtube
//popup window
AlertDialog.Builder popupwin = new AlertDialog.Builder(this);
LayoutInflater inflater = this.getLayoutInflater();
//try
popupwin.setTitle("Y");
popupwin.setIcon(R.drawable.ic_launcher);
popupwin.setView(inflater.inflate(R.layout.pop_up_win, null)).setPositiveButton(getString(R.string.Continue), new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
//Action for 'Ok' Button
EditText youtue_title;
EditText youtube_description;
youtue_title=(EditText)findViewById(R.id.youtue_title); //why youtue_title is null ?????
youtube_description=(EditText)findViewById(R.id.youtube_description); ////why youtube_description is null ?????
video_title = youtue_title.getText().toString();
video_description = youtube_description.getText().toString();
Log.d(TAG, video_title +video_description);
PickVideo() ;
}
});
popupwin.show();
}
Это хороший ответ, вы пытаетесь найти EditText внутри вашей точки зрения активности, а не только в вашем диалоге. Замените этот ответ, и вы хорошо пойдете. –
спасибо ... работа безупречный ............... – idan