BVB Source Codes

The Android source code for beginners music player design and source code Show ListActivity.java Source code

Return Download The Android source code for beginners music player design and source code: download ListActivity.java Source code - Download The Android source code for beginners music player design and source code Source code - Type:.java
  1. package cn.com.karl.music;
  2.  
  3. import java.util.List;
  4.  
  5. import cn.com.karl.adapter.MusicAdapter;
  6. import cn.com.karl.domain.Music;
  7. import cn.com.karl.util.MusicList;
  8. import android.app.Activity;
  9. import android.content.Intent;
  10. import android.os.Bundle;
  11. import android.view.View;
  12. import android.view.View.OnClickListener;
  13. import android.widget.AdapterView;
  14. import android.widget.AdapterView.OnItemClickListener;
  15. import android.widget.ListView;
  16.  
  17. public class ListActivity extends Activity {
  18.  
  19.         private ListView listView;
  20.         @Override
  21.         protected void onCreate(Bundle savedInstanceState) {
  22.                 // TODO Auto-generated method stub
  23.                 super.onCreate(savedInstanceState);
  24.                 setContentView(R.layout.listmusic);
  25.                
  26.                 listView= (ListView) this.findViewById(R.id.listAllMusic);
  27.                 List<Music> listMusic=MusicList.getMusicData(getApplicationContext());
  28.                 MusicAdapter adapter=new MusicAdapter(this, listMusic);
  29.                 listView.setAdapter(adapter);
  30.                 listView.setOnItemClickListener(new OnItemClickListener() {
  31.  
  32.                         @Override
  33.                         public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
  34.                                         long arg3) {
  35.                                 // TODO Auto-generated method stub
  36.                                 Intent intent = new Intent(ListActivity.this,
  37.                                                 MusicActivity.class);
  38.                                 intent.putExtra("id", arg2);
  39.                                 startActivity(intent);
  40.                         }
  41.                 });
  42.         }
  43. }
  44.  
downloadListActivity.java Source code - Download The Android source code for beginners music player design and source code Source code
Related Source Codes/Software:
The Android source code to use baidu weather love weather program source code - What's the weather like in this project is an andr... 2016-12-31
Textview perfect display HTML code - Textview perfect display HTML code, including cust... 2016-12-31
Eliminate to bring Android game source code list diamond little game - This project is a based on android AndEngine open ... 2016-12-31
Fast sliding Android example source code letters index and prompt contact list - A simple fast sliding contact list and initials pr... 2016-12-31
The Android source Jane. Beautiful music player development program source code - This project is an open source music player progra... 2016-12-31
skeuocard - Skeuocard progressively enhances credit card input... 2016-12-31
hubot-scripts - DEPRECATED, see https://github.com/github/hubot-sc... 2016-12-31
Jcrop - Jcrop (official) - Image Cropping Plugin for jQuer... 2016-12-31
volt - A Ruby web framework where your Ruby runs on both ... 2016-12-31
touchstonejs - Mobile App Framework powered by React ... 2016-12-31
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top