Good day,
I am trying to add a textview preview to my app. For example, i created a news app with card view and I want to have a few lines on the first screen and then it expands the full story in a new activity onclick.
I have already set up the new activity part but I just need the preview on the first screen
You should have all the News data available on your first Activity
- NewsActivity
.
In that case you just
TextView
with attribute android:maxLines="3"
TextView
you would open another activity with an Intent
and inside the Intent
pass whole News object
that corresponds to data displayed in preview TextView
. Remember that News object
should be implement Serializable
or Parcelable
interfaces to be passed with intent. Intent
and display it in the second Activity
- NewsDetailsActivity