Thank you Mark,
Worked not like a charm at all, but work non the less :D
I found it awfully complicated and not very well documented just to
set a font size, or a layout.
The setAdapter seems to be pretty powerful although I'm not sure I
understood everything.
For future reference, in the onCreateDialog of an Activity :
---------------------------------------------------------------------------------------
final CharSequence[] itemsMark =
{getResources().getString(R.string.Mark_As_Beautiful),
getResources().getString(R.string.Mark_As_Fun),
getResources().getString(R.string.Mark_As_Not_A_Portrait),
getResources().getString(R.string.Mark_As_Offensive),
getResources().getString(R.string.Mark_As_Spam),
getResources().getString(R.string.Mark_As_Cancel)
};
ArrayAdapter<CharSequence> itemsAdapter = new
ArrayAdapter<CharSequence> (this,
R.layout.menu_items, itemsMark);
builder = new AlertDialog.Builder(this);
builder.setTitle("My Title");
builder.setIcon(R.drawable.icon);
builder.setAdapter(itemsAdapter, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int item) {
switch(item) {
case 0:
//Mark as Beautiful
break;
case 1:
//Mark as Beautiful
break;
case 2: //Mark as Not a Portrait
break;
case 3:
//Mark as Offensive
break;
case 4:
//Mark as Spam
break;
case 5:
//cancel
break;
}
}
});
--------------------------------------------
And in my layout/menu_items.xml :
--------------------------------------------
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:layout_margin="5dip"
android:gravity="center_vertical"
android:textSize="22dip"
android:textColor="#ff000000"
android:typeface="normal"
android:lineSpacingExtra="0dip"/>
--------------------------------------------
Anyway, I stopped trying to do something fancy, regular black on white
labels with default pressed state and I'm good to go.
Thanks again.
Yahel
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.