i am trying to expand textview in android, i have textview with some bulk content, my requirement is to display only two lines from bulk content with finishing (...). if i click it, my full content will has to display. how to achieve this. could you please help me?
public class MainActivity extends ActionBarActivity {
TextView t1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
t1 = (TextView) findViewById(R.id.text);
String str = "If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. This allows animations for those drawables to be scheduled." +
"I made the expandable list view acc to your tutorial but what i have to do if I want to populate Expandable List View with values from database?Means what changes I have to do in ";
t1.setText(str);
t1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
t1.setMaxLines(Integer.MAX_VALUE);
}
});
}
}