android - Show different text content on same activity -


i working on first aid app, on main activity have list of around 40 diseases, when clicked on item, moves next activity showing different content related disease. question is, make 40 different activities each disease, or if not how make single activity show different content according clicked disease, , how style text content, because each content may contain different bullets, heading, length of text can different each disease.

one activity , when start in intent send text images styles or whatever need

intent diseaseintent = new intent(this, diseaseactivity.class) diseaseintent.putstringextra("key", textofdisease); startactivity(diseaseintent); 

and in diseaseactivity's oncreate use

string textofdisease = getintent().getstringextra("key", "value if string null"); yourtextview.settext(textofdisease); 

you can add more fields to intent here documentation: https://developer.android.com/reference/android/content/intent.html luck


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -