본문 바로가기

안드로이드

(21)
[8] Intent(3) - Intent보낼때 Class 통째로 실어 보내기. 개봉박두예쩡 https://medium.com/@henen/%EB%B9%A0%EB%A5%B4%EA%B2%8C-%EB%B0%B0%EC%9A%B0%EB%8A%94-%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-intent-4-%EB%82%B4%EA%B0%80-%EB%A7%8C%EB%93%A0-class%EB%A5%BC-%EC%A0%84%EC%86%A1-serializable-%EC%9D%B4%EC%9A%A9-5fddf7e3c730
[6] Intent (1) - 인텐트 기본 명시적 인텐트 - 실행할 다음 엑티비티의 클래스이름을 넘겨주어 새 엑티비티를 실행 암시적 인텐트 - 다른 기능을하는 앱을 호출 - 예를 들어 사이트의 url를 가지고 있고 이 url을 다른 브라우저 앱으로 실행을 시키고 싶다고 하면 다음과 같이 하면 된다. Intent intent =new Intent(Intent.ACTION_VIEW,Uri.parse(url주소)); // 다른브라우져로 열어준다. startActivity(intent); - 예를들어 전화를 걸고 싶을떄 , 1) 전화를 걸지않고 전화앱에서 번호까지만 입력해준다. Intent intent = new Intent(Intent.ACTION_DIAL,Uri.parse(“tel:”+“전화번호”)); startActivity(intent); 2) ..
[4]ListView ListView listview; listview =(Listview) findById(R.id.list_view_id); List data= new ArrayList(); ArrayAdapter adapter= new ArrayAdapter(this,android.R.layout.simple_list_item_1,data);//연결해주는 다리역할 listview.setAdpater(adpater); data.add("안녕"); data.add("리스트뷰에 넣을거야");
[3]Android Manifest android: icon = "@" // drawable 폴더나 minmap 폴더에 넣어주고 여기에 지정하면 앱의 아이콘이 변경된다. android: label = "@string/app_name " // string.xml 파일에서 app_name 으로 이름을 지정해주면 된다. android: thema ="@style/ ~~ " //style.xml 파일에서 색상을 지정해주면 된다. android: android: //얘가 위의 엑티비티를 메인엑티비티로써 활성화 되도록 해준다. // 메인이며 런쳐이다.
[2]Toast Message 토스트 메세지는 , 토스트기에서 나오는 토스트처럼 안드로이드 하단에서 뿅하고 나타나는 안내메세지이다. 다음과 같은 예제로 알아보겠다. ImageView temp= (ImageView)findViewById(R.Id.imageview_temp); temp.onClickListner( new View.onClickListner ){ @Override public void onClick(View v ){ Toast. makeText ( getApplicattionContext() , "안녕" , Toast.LENGTH_SHORT).show(); } }