Compilation errors with android.widget.MediaController

╄→гoц情女王★ 提交于 2019-12-12 03:44:58

问题


I'm trying to customize the MediaController. While doing so, I've stumbled upon a problem. Both my slightly modified version and the unmodified source of MediaController won't compile with intelliJ IDEA. When compiling the unmodified source code I get these errors:

mWindow = PolicyManager.makeNewWindow(mContext);

Gives the error:

cannot find symbol
symbol : variable PolicyManager
location: class android.widget.MediaController

Next error:

if (event.getRepeatCount() == 0 && event.isDown() && (
            keyCode ==  KeyEvent.KEYCODE_HEADSETHOOK ||
                    keyCode ==  KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE ||
                    keyCode ==  KeyEvent.KEYCODE_SPACE))

Gives the error:

Cannot find symbol
symbol : method isDown()
location: android.view.KeyEvent

My modified code also gives the above errors but also two more:

FrameLayout.LayoutParams = new FrameLayout.LayoutParams(
      ViewGroup.LayoutParams.FILL_PARENT,
      ViewGroup.LayoutParams.FILL_PARENT
);

Gives the error:

cannot find symbol
symbol : variable LayoutParams
location: class android.widget.FrameLAyout

Next error:

addView(v, frameParams);

Gives the error:

cannot find symbol
symbol : variable frameParams
location: class ........

I would be most thankful for any help.

I got the source code from GrepCode, http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/2.0_r1/android/widget/MediaController.java/?v=source


回答1:


MediaController requires access to classes and methods that are not part of the Android SDK, and therefore cannot be built as part of a regular SDK application.



来源:https://stackoverflow.com/questions/14775232/compilation-errors-with-android-widget-mediacontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!