본문 바로가기

개발도구

[Android] addHeaderView -ListActivity with a header or footer 오른쪽과 같이 이미지와 listview 을 한개의 scroll 을 유지하려먼 addHeaderView 에 대해 알아야 한다. addHeaderView 에 관해 구글서치 중에 좋은 블로그가 있어 담아두고 싶다. 여러군대 찾아 봣지만, 다들 어렵고 쉽게 소스 위주로 되어 있어 쉽게 이해할수 있을것이다. :)링크 : http://www.samcoles.co.uk/mobile/android-listactivity-with-a-header-or-footer/ Android ListActivity with a header or footer This post will show you how to go about implementing a ListActivity with a header or footer that do.. 더보기
[안드로이드] Gallery View [펌] 외국 블로그의 글을 갖고 왔는데, 어렵지 않아 쉽게 해석하며 끝부분에 소스가 있으니 참고하면 좋을거 같다. :) Gallery View | Android Developer Tutorial Continuing on the Views, I have taken up the Gallery View that helps in showing Images as in a gallery. As per the android documentation, this is the definition: “A Gallery is a View commonly used to display items in a horizontally scrolling list that locks the current selection at the ce.. 더보기
[안드로이드] ListActivity 와 Adapter [펌] ListActivity를 상속하는 액티비티를 작성할 경우 ListView의 어댑터를 설정할 때 ListView를 참조하는 객체를 만들지 않아도어댑터를 지정할 수 있지만 ListView의 id를 필히@android:id/list 로 설정하여야 한다. 그렇지 않으면 아래와 같은 런타임 오류가 발생한다. 상속받은 클래스 종류 Activity ListActivity .xml 에서 ListView 태그의 ID 값 @+id/~~~ @android:id/list 자바파일에서 어댑터 연결 메소드 setAdapter() setListAdapter() ListView 에 표시된 항목을 클릭했을 때 어떤 동작을 구현하고자 할 경우 ListActivity 내의 onListItemClick() 메소드를 오버라이드한 후 구현한다.. 더보기
intent.setFlags intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // 왼쪽으로 밀어 내기 intent.setFlags(intent.FLAG_ACTIVITY_NEW_TASK); // 위로 밀어 넣기 더보기
[안드로이드] activitygroup sample 참고 사이트 : http://y-anz-m.blogspot.com/2011/02/android1-activity-activitygroup.html ActivityGroup 을 통해 Intent 안에 또 Intent을 넣을수 있다. TabActivity (Activity) | |+--- Tab1 (ActivityGroup) | | | |+---- 子Activity1 (Activity) | | | |+---- 子Activity2 (Activity) | |+--- Tab2 (Activity) | |+--- Tab3 (Activity) Host.java intent = new Intent().setClass(this, MyActivityGroup.class); spec = tabHost.newTabSpec("t.. 더보기
[안드로이드] TabHost tabHost.addTab(tabHost.newTabSpec("tab1") .setIndicator("list") .setContent(new Intent(this, List1.class))); tabHost.addTab(tabHost.newTabSpec("tab2") .setIndicator("photo list") .setContent(new Intent(this, List8.class))); // This tab sets the intent flag so that it is recreated each time // the tab is clicked. tabHost.addTab(tabHost.newTabSpec("tab3") .setIndicator("destroy") .setContent(new I.. 더보기
[안드로이드] Activity가 실행되는 동안 화면 안꺼지게 하기 현재 Activity가 보여지고 있는 동안은 시간이 지나도 화면이 자동으로 꺼지지 않도록 합니다. .addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 더보기
[안드로이드] 화면전환 고정시키기 및 또 다른 방법 Activity 를 상속받은 클래스에서 onCreate() 안에 super.onCreate() 전에 다음 함수를 실행 시켜주면 간단하게 고정이 됩니다. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//화면가로모드 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // 세로 유지 - 또는 AndroidManifest.xml 을 수정시하시는 것이 더 좋을거 같습니다. (세로 고정) android:screenOrientation="portrait" (가로 고정) android:screenOrientation="landscape" 더보기
[안드로이드] TitleBar 없애기 android:label="@string/app_name"                  android:theme="@android:style/Theme.NoTitleBar"> 더보기
[Android] Intent 활용 예시[펌] http://theeye.pe.kr/entry/a-tip-of-android-intent-with-simple-examples [펌] // 웹페이지 띄우기 Uri uri = Uri.parse("http://www.google.com"); Intent it = new Intent(Intent.ACTION_VIEW,uri); startActivity(it); // 구글맵 띄우기 Uri uri = Uri.parse("geo:38.899533,-77.036476"); Intent it = new Intent(Intent.Action_VIEW,uri); startActivity(it); // 구글 길찾기 띄우기 Uri uri = Uri.parse("http://maps.google.com/maps?f=d&sadd.. 더보기