본문 바로가기

개발도구/aOS - 안드로이드 개발

[안드로이드] tabHost 와 tab버튼 이미지 변경 protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.host); tabHost = getTabHost(); tabHost.setOnTabChangedListener(this); tabHost.addTab(tabHost.newTabSpec("tab1") .setIndicator("",getResources().getDrawable(R.drawable.tab_menu1_off)) .setContent(new Intent(this, PhotoSwitcher.class))); tabHost.addTab.. 더보기
[안드로이드] 타이틀바 없애기 AndroidMenifest.xml에 적용 Application 전체에 적용 application에 android:theme="@android:style/Theme.NoTitleBar" 삽입 특정 Activity 에 적용 activity에 android:theme="@android:style/Theme.NoTitleBar" 삽입 Code에 적용 TestClass.java setContentView() 보다 먼저 처리되야 한다. import android.app.Ativity; import android.os.Bundle; public class TestClass extends Activity { @Override public void onCreate(Bundle savedInstanceState) { .. 더보기
Log.d 숫자 찍어보기 Log.d("111", this.getString(temp_id)); 형변환 int temp = Integer.parseInt(a.getText().toString()); int.Parser()는 이렇게 사용하시면 됩니다.^^ 혹은 int temp = Integer.valueOf(a.getText().toString()); 더보기
[안드로이드] 인트로 intro 구성하기 package kr.co.mt; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.KeyEvent; import android.view.Window; /** * 초기화면 * * @author joon * */ public class Intro extends Activity { Handler myHandler = new Handler(); Runnable myRunnable = new Runnable() { public void .. 더보기
[안드로이드] ListView에 header 을 달자! - addHeaderView private View header; header = null; header = inflater.inflate(R.layout.header, null); // header.xml g = (MyGallery) header.findViewById(R.id.gallery); titlelistTxt = (TextView) header.findViewById(R.id.titlelistTxt); layout = (LinearLayout) header.findViewById(R.id.dotPanel); // list3 는 R.layout.main list3.addHeaderView(header); // * addheaderview 는 단 한번만 실행이 되야 한다. 여러번 실행되어도 에러는 안나지만, 화면이 떨리거나,.. 더보기
[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.. 더보기