public void showToast(String text, int resourceId, View tv_menuTitle) {
LayoutInflater inflater = LayoutInflater.from(this);
View v = inflater.inflate(R.layout.voice_mode_toggle, null);
TextView tv = (TextView) v.findViewById(R.id.tv_voice_toggle);
tv.setText(text);
tv.setCompoundDrawables(getCompoundDrawable(resourceId), null, null,
null);
Toast toast = new Toast(this);
toast.setView(v);
toast.setGravity(Gravity.TOP | Gravity.FILL_HORIZONTAL, 0,
tv_menuTitle.getHeight());
toast.setDuration(500);
toast.show();
}
LayoutInflater inflater = LayoutInflater.from(this);
View v = inflater.inflate(R.layout.voice_mode_toggle, null);
TextView tv = (TextView) v.findViewById(R.id.tv_voice_toggle);
tv.setText(text);
tv.setCompoundDrawables(getCompoundDrawable(resourceId), null, null,
null);
Toast toast = new Toast(this);
toast.setView(v);
toast.setGravity(Gravity.TOP | Gravity.FILL_HORIZONTAL, 0,
tv_menuTitle.getHeight());
toast.setDuration(500);
toast.show();
}