0

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

TimWagaman
  • 980
  • 1
  • 10
  • 31

1 Answers1

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thank you for the answer. Would it be possible to import them from somewhere else? If possible, from where? – Albin Säpo Mattsson Feb 09 '13 at 16:29
  • @AlbinSäpoMattsson: `MediaController` as it stands can only be built as part of a full framework build, by downloading the whole OS and compiling it all. You are welcome to build your own media controller that does not have these limitations. – CommonsWare Feb 09 '13 at 17:06