Android
- 24 ответа
- 0 вопросов
16
Вклад в тег
class CocktailItem{
String title;
String description;
Bitmap icon;
}
AdapterView.OnItemClickListener() {
@Override
public
void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id) {
CocktailItem item = (CocktailItem) parent.getAdapter().getItem(position);
AlertDialog.Builder builder = new AlertDialog.Builder(ShotDrinks.this);
builder.setTitle(item.title)
.setMessage(item.description)
.setCancelable(true)
.setIcon(R.drawable.ic_launcher)
...
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
...
getActionBar().setDisplayHomeAsUpEnabled(true);
}
<style name="ActionBarStyle">
...
<item name="android:displayOptions">showTitle|homeAsUp</item>
<item name="displayOptions">showTitle|homeAsUp</item>
</style>
<style name="Theme.UpTheme" parent="Theme.Holo">
...
<item name="android:actionBarStyle">@style/ActionBarStyle</item>
</style>
<activity
....
android:theme="@style/Theme.UpTheme"/>