custom alertdialog 를 만들고 있는데요.
메인 activity -> 또다른 activity start -> custom alertdialog
이러한 식으로 alert 를 호출하고 있습니다.
public class SetDevice extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_setdevice);
Button selected_device = (Button)findViewById(R.id.selectdevice);
selected_device.setOnClickListener(new Click_SelectedDevice());
}
public class Click_SelectedDevice implements OnClickListener {
@Override
public void onClick(View v) {
Context mContext5 = getApplicationContext();
LayoutInflater inflater5 = (LayoutInflater)mContext5.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout5 = inflater5.inflate(R.layout.bluetoothdevice_list,(ViewGroup)findViewById(R.id.list_layout33));
AlertDialog.Builder aDialog = new AlertDialog.Builder(getApplicationContext());
aDialog.setTitle("장비목록");
aDialog.setView(layout5);
aDialog.setPositiveButton("확인", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog ad5 = aDialog.create();
ad5.show();
}
}
}
이러한 에러가 납니다.
05-16 14:56:45.957: E/AndroidRuntime(1305): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
05-16 14:56:45.957: E/AndroidRuntime(1305): at android.view.ViewRootImpl.setView(ViewRootImpl.java:519)
다른거 디버깅해보니 상댱량이 null 이 들어 가는 것은 맞는것 같긴 한데요...ㅜㅜ