New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass "title" data from addItems to another activity? #21
Comments
Could you please send snipet of your code? |
in this code whenever i pressed something from subItem it shows me the toast message of the click subitem for example if i clicked on 'house' it shows me house in toast. how can I do same with title one? i mean whenever i clicked something from subitem then it will show me the title in which the subitem is present. for example if i clicked on 'dog' which is present in title "Mary" then the toast message will show me "Mary" |
Please need your help sorry for the noob question @diegodobelo |
Like this: private void configureSubItem(final ExpandingItem item, final View view, final String subTitle) {
((TextView) view.findViewById(R.id.sub_title)).setText(subTitle);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String title = ((TextView) item.findViewById(R.id.title)).getText().toString();
String text = title + " - " + subTitle;
Toast.makeText(getApplicationContext(),text,Toast.LENGTH_LONG).show();
}
});
} |
Thanks, alot sir. I really mean it for sparing your precious time and effort to solve my problem! |
I am able to pass data of subItem but i am not able to pass title data. I have to assign it in a String Variable but it catches the last data from addItem i.e Bart. Sorry for the noob question i am new to the android development @diegodobelo
The text was updated successfully, but these errors were encountered: