// Path: src/main/java/com/inovex/zabbixmobile/adapters/HostGroupsSpinnerAdapter.java
// public class HostGroupsSpinnerAdapter extends BaseServiceAdapter<HostGroup> {
// 
// 	private String mTitle;
// 	private int mHostGroupPosition;
// 	private OnHostGroupSelectedListener mCallback;
// 
// 	public interface OnHostGroupSelectedListener {
// 		public void onHostGroupSelected(int position);
// 	}
// 
// 	public HostGroupsSpinnerAdapter(ZabbixDataService service) {
// 		super(service);
// 		addBaseGroups();
// 	}
// 
// 	public void setCallback(OnHostGroupSelectedListener callback) {
// 		this.mCallback = callback;
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 
// 		View actionBarView = getInflater().inflate(
// 				R.layout.toolbar_spinner_item_actionbar, null);
// 		TextView subtitle = (TextView) actionBarView
// 				.findViewById(android.R.id.text2);
// 		subtitle.setText(getItem(position).getName());
// 		return actionBarView;
// 
// 	}
// 
// 	@Override
// 	public View getDropDownView(int position, View convertView, ViewGroup parent) {
// 		View actionBarDropDownView = getInflater().inflate(
// 				R.layout.toolbar_spinner_item_dropdown, null);
// 		TextView dropDownTitle = (TextView) actionBarDropDownView
// 				.findViewById(android.R.id.text1);
// 
// 		dropDownTitle.setText(getItem(position).getName());
// 
// 		return actionBarDropDownView;
// 
// 	}
// 
// 	public void setTitle(String title) {
// 		mTitle = title;
// 	}
// 
// 	@Override
// 	public long getItemId(int position) {
// 		HostGroup item = getItem(position);
// 		if(item != null)
// 			return item.getGroupId();
// 		return 0;
// 	}
// 
// 	@Override
// 	public void clear() {
// 		super.clear();
// 		addBaseGroups();
// 	}
// 
// 	/**
// 	 * Adds the base host group for the display of all items.
// 	 */
// 	private void addBaseGroups() {
// 		mObjects.add(new HostGroup(HostGroup.GROUP_ID_ALL, mZabbixDataService
// 				.getResources().getString(R.string.hostgroup_all)));
// 	}
// 
// 	@Override
// 	public void setCurrentPosition(int position) {
// 		this.mHostGroupPosition = position;
// 	}
// 
// 	@Override
// 	public int getCurrentPosition() {
// 		return mHostGroupPosition;
// 	}
// 
// 	public long getCurrentItemId() {
// 		return getItemId(mHostGroupPosition);
// 	}
// 
// 	@Override
// 	public void notifyDataSetChanged() {
// 		super.notifyDataSetChanged();
// 		// update the current selection (we might have saved this position
// 		// before)
// 		refreshSelection();
// 	}
// 
// 	public void refreshSelection() {
// 		if (mCallback != null && mObjects.size() > mHostGroupPosition)
// 			mCallback.onHostGroupSelected(mHostGroupPosition);
// 	}
// 
// }
// 
// Path: src/main/java/com/inovex/zabbixmobile/adapters/HostGroupsSpinnerAdapter.java
// public interface OnHostGroupSelectedListener {
// 	public void onHostGroupSelected(int position);
// }


import android.content.ComponentName;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Spinner;
import com.inovex.zabbixmobile.R;
import com.inovex.zabbixmobile.adapters.HostGroupsSpinnerAdapter;
import com.inovex.zabbixmobile.adapters.HostGroupsSpinnerAdapter.OnHostGroupSelectedListener;
	}

	@Override
	protected void onResume() {
		super.onResume();

		if (mSpinnerAdapter != null) {
			mSpinnerAdapter.setCallback(this);
			mSpinnerAdapter.refreshSelection();
		}
		if(mHostgroupToolbar != null){
			mHostgroupSpinner = (Spinner) mHostgroupToolbar.findViewById(R.id.hostgroup_select_spinner);
			mHostgroupSpinner.setAdapter(mSpinnerAdapter);
		}

		// reload adapter
		if (mZabbixDataService != null && mZabbixDataService.isLoggedIn())
			loadAdapterContent(false);
	}

	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
	}

	/**
	 * Sets up the host group spinner and loads required data from Zabbix.
	 */
	@Override
	public void onServiceConnected(ComponentName className, IBinder binder) {
// Path: src/main/java/com/inovex/zabbixmobile/adapters/HostGroupsSpinnerAdapter.java
// public class HostGroupsSpinnerAdapter extends BaseServiceAdapter<HostGroup> {
// 
// 	private String mTitle;
// 	private int mHostGroupPosition;
// 	private OnHostGroupSelectedListener mCallback;
// 
// 	public interface OnHostGroupSelectedListener {
// 		public void onHostGroupSelected(int position);
// 	}
// 
// 	public HostGroupsSpinnerAdapter(ZabbixDataService service) {
// 		super(service);
// 		addBaseGroups();
// 	}
// 
// 	public void setCallback(OnHostGroupSelectedListener callback) {
// 		this.mCallback = callback;
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 
// 		View actionBarView = getInflater().inflate(
// 				R.layout.toolbar_spinner_item_actionbar, null);
// 		TextView subtitle = (TextView) actionBarView
// 				.findViewById(android.R.id.text2);
// 		subtitle.setText(getItem(position).getName());
// 		return actionBarView;
// 
// 	}
// 
// 	@Override
// 	public View getDropDownView(int position, View convertView, ViewGroup parent) {
// 		View actionBarDropDownView = getInflater().inflate(
// 				R.layout.toolbar_spinner_item_dropdown, null);
// 		TextView dropDownTitle = (TextView) actionBarDropDownView
// 				.findViewById(android.R.id.text1);
// 
// 		dropDownTitle.setText(getItem(position).getName());
// 
// 		return actionBarDropDownView;
// 
// 	}
// 
// 	public void setTitle(String title) {
// 		mTitle = title;
// 	}
// 
// 	@Override
// 	public long getItemId(int position) {
// 		HostGroup item = getItem(position);
// 		if(item != null)
// 			return item.getGroupId();
// 		return 0;
// 	}
// 
// 	@Override
// 	public void clear() {
// 		super.clear();
// 		addBaseGroups();
// 	}
// 
// 	/**
// 	 * Adds the base host group for the display of all items.
// 	 */
// 	private void addBaseGroups() {
// 		mObjects.add(new HostGroup(HostGroup.GROUP_ID_ALL, mZabbixDataService
// 				.getResources().getString(R.string.hostgroup_all)));
// 	}
// 
// 	@Override
// 	public void setCurrentPosition(int position) {
// 		this.mHostGroupPosition = position;
// 	}
// 
// 	@Override
// 	public int getCurrentPosition() {
// 		return mHostGroupPosition;
// 	}
// 
// 	public long getCurrentItemId() {
// 		return getItemId(mHostGroupPosition);
// 	}
// 
// 	@Override
// 	public void notifyDataSetChanged() {
// 		super.notifyDataSetChanged();
// 		// update the current selection (we might have saved this position
// 		// before)
// 		refreshSelection();
// 	}
// 
// 	public void refreshSelection() {
// 		if (mCallback != null && mObjects.size() > mHostGroupPosition)
// 			mCallback.onHostGroupSelected(mHostGroupPosition);
// 	}
// 
// }
// 
// Path: src/main/java/com/inovex/zabbixmobile/adapters/HostGroupsSpinnerAdapter.java
// public interface OnHostGroupSelectedListener {
// 	public void onHostGroupSelected(int position);
// }


// Path: src/main/java/com/inovex/zabbixmobile/activities/BaseHostGroupSpinnerActivity.java
import android.content.ComponentName;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Spinner;
import com.inovex.zabbixmobile.R;
import com.inovex.zabbixmobile.adapters.HostGroupsSpinnerAdapter;
import com.inovex.zabbixmobile.adapters.HostGroupsSpinnerAdapter.OnHostGroupSelectedListener;

	}

	@Override
	protected void onResume() {
		super.onResume();

		if (mSpinnerAdapter != null) {
			mSpinnerAdapter.setCallback(this);
			mSpinnerAdapter.refreshSelection();
		}
		if(mHostgroupToolbar != null){
			mHostgroupSpinner = (Spinner) mHostgroupToolbar.findViewById(R.id.hostgroup_select_spinner);
			mHostgroupSpinner.setAdapter(mSpinnerAdapter);
		}

		// reload adapter
		if (mZabbixDataService != null && mZabbixDataService.isLoggedIn())
			loadAdapterContent(false);
	}

	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
	}

	/**
	 * Sets up the host group spinner and loads required data from Zabbix.
	 */
	@Override
	public void onServiceConnected(ComponentName className, IBinder binder) {
		super.onServiceConnected(className, binder);