How to add drawables to a view programmatically from a URL but not in xml layout
<p>I'm currently trying to create an Android View object dynamically and then add this view to a widget based on some user selection from a gallery. The problem is that it does not have setters for drawable resources. The only way to set the images is if I predefine an xml layout. I cannot then set the user selected images. </p>

<p>Even though I can create a view it will not have the right properties set. I tried implementing my own and exposing the drawables but then ran in to the issue "Class Not Found" and I've read its impossible to get around. </p>

<p>Is it possible to provide something in the AttributeSet on the constructor? </p>

<p>Really struggling, I don't even need a custom view if I could find a way to set the options.</p>

<pre><code> android:drawable1="@drawable/predefined_image"
 android:drawable2="@drawable/predefined_image" 
</code></pre>

<p>And pass this via an AttributeSet since I know it just takes these and creates drawables from them.</p>

<hr>

<p>Okay lets clarify the question a little, </p>

<p>I have an xml layout file </p>

<pre><code>&lt;AndroidSystemWidget
android:drawable1="@Drawable/drawable1"
android:drawable2="@Drawable/drawable2"
/&gt;
</code></pre>

<p>Now I have 2 png files on the SD card
/sdcard/pictures/image1.png
/sdcard/pictures/image2.png</p>

<p>Now in the code there are no exposed setters for drawable1 or 2 there is only a single constructor </p>

<pre><code>AndroidSystemWidget widget = new AndroidSystemWidget(Context, AttributeSet)
</code></pre>

<p>I want to create this AndroidSystemWidget in my widget configuration with the two png files above set to drawable1 and drawable2 and then set it via Views on the app widget provider.</p>
