현재 소스에서 이미지 클릭하면 음악이 나오게 하고 싶습니다.
음악파일은 2개 이구요 "m1" "m2"
음악을 나오게 하고 싶은데 좌측 옆에 "이미지이름 "아티스트" "시간(텍스트)"나오게 하고 싶어요. 이건 ui로 처리 하면 됩니다. sdk는 4.4.2 bundle을 쓰고 있습니다.
어딜 수정하면 좋을까요?
<activity_main.xml>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="
http://schemas.android.com/apk/res/android"
xmlns:tools="
http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/image1"
android:paddingRight="5sp"
android:layout_weight="1"
android:adjustViewBounds="true" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title01" />
<Textview
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/artist01" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@drawable/image2"
android:paddingLeft="5sp"
android:layout_weight="1"
android:adjustViewBounds="true" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:orientation="vertical" >
<Textview
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title02" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/artist02" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<MainActivity.java>
package com.example.image2;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}