title: android -> how to create own widget based on original widget's source
body: <p>How do I create my own gallery widget (or any other, in my case its a gallery) based on the original gallery's widget? I want to "copy and paste" <a href="http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/widget/Gallery.java/?v=source" rel="nofollow">source code</a> into the new file in my package, change some widget's properties and methods and use my own gallery (override doesn't take effect in my case). I tried to do this operation, but it throws me a lot of errors, such as com.android.internal.R, android.annotation.Widget not exists, and a lot of undefined methods and properties. I didn't work with the widget annotations, so I don't know how to release such error.</p>
  
  <p>Is it possible to do that?</p>