add text to a drawable? (maps question)

by Michael Dorin » Wed, 10 Mar 2010 23:26:31 GMT

Sponsored Links
 I am doing a map application and would like to put more than just a
'star' or a 'pin' on the map when it is selected.
Is it possible to make a drawable icon, and shove some text into it?
That way I could have a bit of info and the location tagged.



add text to a drawable? (maps question)

by Mark Murphy » Wed, 10 Mar 2010 23:29:29 GMT


You can certainly have different Drawables per pin at runtime: 

I haven't tried creating a custom Drawable, rendered from a Canvas or
something, so I don't know much about that aspect.

Mark Murphy (a Commons Guy)  | 

Android Training...At Your Office: 


Sponsored Links

Other Threads

1. Can alternative menu items display icons in m5?

I want to include an alternative menu item, similar as is done in the
NotesList sample, but I want to add an icon. What would be the
appropriate place to specify the icon?

I'm adding the alternative menu through the following code:

Intent intent = new Intent(null, mListUri);
                Menu.ALTERNATIVE, 0,
                new ComponentName(this, ShoppingView.class),
                null, intent, 0, null);

which displays correctly the menu item that is specified here:

<activity android:name=".shopping.ListShareSettingsActivity"
Theme.Dialog"           android:icon="@drawable/contact_share001a">
             <intent-filter android:label="@string/share"
android:name="org.openintents.action.SET_SHARE_SETTINGS" />
android:name="android.intent.category.DEFAULT" />
android:name="android.intent.category.ALTERNATIVE" />
android:name="android.intent.category.SELECTED_ALTERNATIVE" />
                <data android:mimeType="" />

It shows the string as specified in @string/share, but I don't get to
see the icon specified in @drawable/contact_share001a.

Since the notepad example does not display menu icons, it is difficult
to tell whether this feature should work in principle in m5 or not.



2. About bullets


 Can we use bullets in android.if so?what is the syntax pls tell me



3. Asynchronously loading problem

4. Revenue generated by developers

5. Assess other variable from other class in the same package !

6. how to show alerts

7. Selecting from a do I know what I clicked on?