0

I am looking to find a way to add a SeekBar to a homescreen widget. After reading this post on StackOverflow, I found that SeekBar's are not supported within a RemoteView, because it is a descendant of a ProgressBar. (Descendants of the accepted widgets are not supported)

Though, in my project, I am using Lars Werkman's HoloColorPicker found here. If you notice in the src, his OpacityBar (which is essentially a SeekBar) extends a View. Since all the accepted widgets (here) are descendants of View, I would think this would work. But alas, upon trying to load the homescreen widget with the OpacityBar, it shows up with the "Problem loading widget" response.

Does anyone know why this doesn't work? And know how to make it work?

Or does anyone know how to get a working SeekBar within a homescreen widget?

Thank you!

Community
  • 1
  • 1
BarryBostwick
  • 919
  • 2
  • 12
  • 21

1 Answers1

1

Since all the accepted widgets (here) are descendants of View, I would think this would work

I have no idea why you conclude that, as it it is a logical fallacy. According to your logic, since negative numbers are types of number, all numbers are negative.

Does anyone know why this doesn't work?

Because you cannot use custom Views, or anything else not supported by RemoteViews, in an app widget.

And know how to make it work? Or does anyone know how to get a working SeekBar within a homescreen widget?

Write your own home screen, and implement whatever you are trying to do with the SeekBar in that custom home screen.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Okay that makes sense. Are you referring me to do something like [this](http://stackoverflow.com/questions/3666771/how-can-i-create-a-custom-home-screen-replacement-application-for-android)? – BarryBostwick Sep 29 '13 at 22:56
  • @BarryBostwick: "Are you referring me to do something like this?" -- in the third paragraph of my answer, yes. – CommonsWare Sep 29 '13 at 22:57
  • This doesn't seem like the solution I am looking for. A better question may be: if you look at [this app](https://play.google.com/store/apps/details?id=de.hinterhofapps.sliderwidget&hl=en), each button in the homescreen widget opens a pop-up with a `SeekBar` in it. Do you know what it is doing underneath to make this work? – BarryBostwick Sep 29 '13 at 23:12
  • 1
    @BarryBostwick: That is a dialog-themed activity, in all likelihood. IIRC, there's an extra that is passed along with the `Intent` used to start your activity when it is launched from an app widget, which contains some coordinate details of where the app widget was on the screen, for positioning purposes. – CommonsWare Sep 29 '13 at 23:19