```
using static src.menuEvent.HardKeyMenuEvent.AdjustPopupEvent;
using static src.menuEvent.HardKeyMenuEvent.PowerPopupEvent;
using static src.menuEvent.HardKeyMenuEvent.BrilliancePopupEvent;
using System.Collections.Generic;
namespace Fec.Test
{
[Activity(Label = "Fec.Test", Icon = "@drawable/icon", ScreenOrientation = ScreenOrientation.SensorLandscape)]
public class RadarDispActivity : Activity
{
public static Spinner _Palett_Spinner;
public static ArrayList _Palett_List;
protected override void OnCreate(Bundle bundle)
{
instance = this;
base.OnCreate(bundle);
this.RequestWindowFeature(WindowFeatures.NoTitle); //Remove title bar
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.RadarDispMain);
Initialize(this);
}
public override Boolean DispatchKeyEvent(KeyEvent e)
{
_Main_Fragment = FragmentManager.BeginTransaction();
src.menu.MainTitle _Main_Title_Fragment = new src.menu.MainTitle();
switch (e.KeyCode)
{
case Keycode.Num4:
if(e.Action == KeyEventActions.Down)
{
LayoutInflater _Brill_inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService);
_Brill_Popup = _Brill_inflater.Inflate(Resource.Layout.Menu_Brill_Window, null);
BrillEvent();
}
break;
}
return false;
}
return false;
}
```
```
using static Fec.Test.RadarDispActivity;
namespace src.menuEvent
{
class HardKeyMenuEvent : AbstractDataInterface
{
public static class BrilliancePopupEvent
{
public static void BrillEvent()
{
PopupWindow _Brill_Window = new PopupWindow(_Brill_Popup, 500, 300);
_Brill_Window.SetBackgroundDrawable(new BitmapDrawable());
_Palett_Spinner = (Spinner)_Brill_Popup.FindViewById(Resource.Id._Palett_Spinner);
_Palett_List = new ArrayList { "Day", "Dusk", "Night" };
_Palett_Spinner.Adapter = new ArrayAdapter(instance, Resource.Layout.Custom_Spinner, Resource.Id._Custom_Spinner_Text, _Palett_List);
}
}
```
간략하게 요런 코드가 있습니다
그런데 HardKey에 4번을 눌러 PopupWindow를 오픈한 후 스피너를 누르려고 하면
Android.Views.WindowManagerBadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@38e83929 is not valid; is your activity running?
이러한 에러가 발생합니다.
Spinner의 Mode 옵션을 DropDown이 아닌 Dialog로 주면 해결이 되긴 하는데
그렇게 되면 Dialog의 폭 크기를 어떻게 줄이는지를 모르겠습니다.
두 가지에 대한 해결법을 알 수 있을까요?
1. Spinner의 Mode 옵션을 Dialog로 주지 않고 DropDown으로 주었을 때 해결 할 수 있는 방법
2. Spinner의 Mode 옵션을 Dialog로 주었을 때, Dialog창의 Width 와 Height를 조절할 수 있는 방법
부탁드립니다!