package as.com;
import android.R.string;
import android.app.*;
import android.app.AlertDialog.Builder;
import android.os.*;
import android.widget.*;
import android.view.*;
import android.content.*;
import java.util.ArrayList;
import free.com.setting.*;
import trouble.com.*;
import win.dows.arr.*;
import android.app.*;
import android.os.Bundle;
import android.widget.*;
import part.explain.*;
public class AsList extends ListActivity {
public void onBackPressed() {
// TODO Auto-generated method stub
//super.onBackPressed(); //지워야 실행됨
Builder d = new AlertDialog.Builder(this);
d.setMessage("정말 종료하시겠습니까?");
d.setPositiveButton("예", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// process전체 종료
finish();
}
});
d.setNegativeButton("아니요", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
d.show();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ArrayList<String> arGeneral = new ArrayList<String>();
arGeneral.add("A01_Teat");
arGeneral.add("A02_Teat");
arGeneral.add("A03_Teat");
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.ascomlist, R.id.aslist, arGeneral);
setListAdapter(adapter);
ListView list = (ListView)findViewById(android.R.id.list);
setListAdapter(adapter);
}
protected void onListItemClick(ListView l, View v, int position, long id)
{
super.onListItemClick(l, v, position, id);
if(id == 0){
Intent intent = new Intent(this, A01_Teat.class);
startActivity(intent);
}
else if(id == 1){
Intent intent = new Intent(this, A02_Teat.class);
startActivity(intent);
}
else if(id == 2){
Intent intent = new Intent(this, A03_Teat.class);
startActivity(intent);
}
}
같은 아이콘으로는 출력이되는데 리스트마다 다른아이콘을 나오게할려면 어떻게해야되나요?