我不知道为什么 youtube_title 和 youtube_description 为空???在我向这个editText添加文本之后???我一直这样做,为什么现在它不起作用???
是否有问题,因为它在弹出窗口中?
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();
}