0
我想自定義MediaController。在這樣做的時候,我偶然發現了一個問題。我的稍微修改過的版本和未經修改的MediaController源代碼都不能用IntelliJ IDEA進行編譯。當編譯修改的源代碼中,我得到這些錯誤:編譯錯誤與android.widget.MediaController
mWindow = PolicyManager.makeNewWindow(mContext);
給出了錯誤:
cannot find symbol
symbol : variable PolicyManager
location: class android.widget.MediaController
下一個錯誤:
if (event.getRepeatCount() == 0 && event.isDown() && (
keyCode == KeyEvent.KEYCODE_HEADSETHOOK ||
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE ||
keyCode == KeyEvent.KEYCODE_SPACE))
給出了錯誤:
Cannot find symbol
symbol : method isDown()
location: android.view.KeyEvent
我的修改代碼也給了上面的錯誤,但也有兩個多:
FrameLayout.LayoutParams = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT
);
給出了錯誤:
cannot find symbol
symbol : variable LayoutParams
location: class android.widget.FrameLAyout
下一個錯誤:
addView(v, frameParams);
給出了錯誤:
cannot find symbol
symbol : variable frameParams
location: class ........
我將是最感謝任何幫助。
謝謝你的回答。有可能從其他地方導入它們嗎?如果可能的話,從哪裏? – 2013-02-09 16:29:01
@AlbinSäpoMattsson:現在的MediaController只能作爲完整框架構建的一部分來構建,通過下載整個OS並編譯完成。歡迎您構建自己的沒有這些限制的媒體控制器。 – CommonsWare 2013-02-09 17:06:12