java - Android-Songs List -


i'm new android , working on project list title of 100 songs. when user clicks on song, window display changes display lyrics of song. i've done similar project,for 2 buttons, used intent start new activity(java class read text file). have 100 text views, there way can achieve same result (display content of text files) without creating 100 java classes read 100 text files ?

so, few suggestions:

  • definitely try go android developer training section comfortable use-cases of common scenarios in android.

  • you stating want display 100 titles, , first thought create 100 textview items in layout. well, let me tell whenever plan on displaying same item (by item mean same layout) multiple times in 1 same contentview, better idea use view can handle reuse you, code simpler manager. can either use listview or gridview.

basically listview uses adapter fill many items need to, using specified layoutresource. read on how use listview here.

  • once have created listview on activity a, set onitemclicklistener list, , whenever item clicked, start intent launch activity b; in intent can include extras, , therefore can pass name of song. on activity b, receive calling mintent.getextras(), , display lyrics supplied song using textview

i give sample code, seems me on stage , don't want confuse you. take time read through official docs, helpful! luck.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -