AlertDialog를 만드는 데 문제가있는 것 같습니다. 내가 뭘 하려는지는 특정 RadioButton이 클릭 될 때 팝업되는 커스텀 AlertDialog를 생성하는 것이다.AlertDialog 생성 관련 문제
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
m_Minutes = -1;
m_this=this;
String prefName = getString(R.string.prefsfile);
SharedPreferences settings = getSharedPreferences(prefName, 0);
String defaultTextBackMessage = settings.getString("textBackMessage", getString(R.string.defaultTextBackMessage));
EditText txtMessage = (EditText)findViewById(R.id.editText1);
txtMessage.setText(defaultTextBackMessage);
final Button button = (Button)findViewById(R.id.button1);
final RadioButton manualButton = (RadioButton)findViewById(R.id.radio0);
final RadioButton button15 = (RadioButton)findViewById(R.id.radio1);
final RadioButton button30 = (RadioButton)findViewById(R.id.radio2);
final RadioButton customButton = (RadioButton)findViewById(R.id.radio3);
manualButton.setChecked(true);
customButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Context c = v.getContext();
LayoutInflater factory = LayoutInflater.from(v.getContext());
final View minuteEntryView = factory.inflate(R.layout.customtime, null);
AlertDialog ad = AlertDialog.Builder(c).create(); // this is the trouble line
}
});
나는 AlertDialog ad = AlertDialog.Builder(c).create();
줄에서 오류가 점점 오전 : 여기 내 관련 코드입니다. 내가 얻는 오류는 The Method Builder(Context) is undefined for the type AlertDialog
입니다. 그러나 분명히 Google API Docs에는 Builder 생성자가 있습니다. 내가 도대체 뭘 잘못하고있는 겁니까?
logcat 오류를 표시 할 수 있습니까? –
@Suri - 런타임 오류가 아닌 컴파일 오류가 발생합니다. – Icemanind
동일한 문제가 발생하여 "새로운"코드를 잊어 버렸습니다. 나는 혼란 한 남자가 필요해! – Ishaan