Schrödinger's cat

@mycupoftea_24

Viet Nam, Ha Noi

Institution: Birla Institute of Technology, Mesra

//SearchActivity package com.example.musicapp; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.SearchView; import androidx.appcompat.app.AppCompatActivity; import java.util.ArrayList; public class SearchActivity extends AppCompatActivity implements SearchView.OnQueryTextListener { ListView mListView; ArrayList<Song> arraySong; ListSongAdapter mSongAdapter; SearchView searchView; @Override protected void onCreate( Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.search); mListView = findViewById(R.id.listviewS); arraySong = new ArrayList<>(); arraySong.add(new Song("Better","Khalid",R.drawable.khalid,R.raw.better_khalid)); arraySong.add(new Song("Big Girls Cry","Sia",R.drawable.sia,R.raw.biggirlscry_sia)); arraySong.add(new Song("Call You Mine","The Chainsmoker",R.drawable.thechansmoker,R.raw.callyoumine_chansmoker)); arraySong.add(new Song("Can We Kiss Forever","Kina",R.drawable.kina,R.raw.canwekissforever_kina)); arraySong.add(new Song("Cheap Thrills","Sia",R.drawable.sia_cheapthrill,R.raw.cheapthrills_sia)); arraySong.add(new Song("Chỉ còn những mùa nhớ","Bảo Trâm",R.drawable.baotram,R.raw.chiconnhungmuanho_baotram)); arraySong.add(new Song("DarkSide","Alan Walker",R.drawable.alanwalerdarkside,R.raw.darkside_alanwalker)); arraySong.add(new Song("Don't let me down","The Chainsmoker",R.drawable.thechansmoker,R.raw.donletmedown_chansmoker)); arraySong.add(new Song("Dusk Till Dawn","Zayn & Sia",R.drawable.zaynsia,R.raw.dusktilldawn_zayn_sia)); arraySong.add(new Song("Eleven","Khalid",R.drawable.khalid2,R.raw.eleven_khalid)); mSongAdapter = new ListSongAdapter(SearchActivity.this,R.layout.song_item_row,arraySong); mListView.setAdapter(mSongAdapter); searchView=findViewById(R.id.searchS); searchView.setOnQueryTextListener(this); mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(SearchActivity.this,PlaySongActivity.class); Bundle bundle=new Bundle(); bundle.putSerializable("arraysong",arraySong); bundle.putInt("position",position); intent.putExtras(bundle); startActivity(intent); Log.d("Click",position + ""); } }); } @Override public boolean onQueryTextSubmit(String query) { return false; } @Override public boolean onQueryTextChange(String newText) { String text = newText; mSongAdapter.filter(text); return false; } } //xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <SearchView android:id="@+id/searchS" android:layout_width="fill_parent" android:layout_height="wrap_content" android:iconifiedByDefault="false"> <requestFocus /> </SearchView> <ListView android:id="@+id/listviewS" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/searchS" /> </RelativeLayout> //Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.musicapp"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".AllSongActivity"> </activity> <activity android:name=".PlaySongActivity"> </activity> <activity android:name=".SearchActivity"> </activity> </application> </manifest>

Các lần nộp bài đã được ghi nhân
(Xem dạng tệp tin văn bản)

Problems

Danh sách các bài đã làm đạt yêu cầu:

P202PROE P205PROE
P203PROB SSAM019D
P203PROD SSAM019L
P204PROB SSAM119H
P204PROE SSAM120B
P204PROF SSAM120D
P205PROD SSAM120E

Danh sách các bài làm chưa đạt yêu cầu:

P202PROB P204PROD
P203PROF SSAM219C
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.