'sms_mms_co'에 해당되는 글 2건

  1. 2010.08.04 cutom title bar
  2. 2010.04.23 외부 app의 DB와 동기화를 위해서 감시하는 코드

cutom title bar

old/UI Design 2010. 8. 4. 15:57
enter code heremy_title.xml 
<ImageView android:src="@drawable/jetpack" 
    android:layout_width="wrap_content" android:layout_alignParentLeft="true" 
    android:layout_centerVertical="true" android:id="@+id/back" 
    android:layout_height="wrap_content" android:layout_alignParentTop="true" /> 
 
<TextView android:id="@+id/title" android:layout_width="wrap_content" 
    android:gravity="center_vertical" android:textSize="20px" 
    android:textColor="#ffffff" android:layout_alignParentRight="true" 
    android:text="New Title" android:background="#a5c639" 
    android:layout_height="wrap_content" android:layout_alignParentTop="true" 
    android:padding="9dip" android:layout_margin="5dip" /> 

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_title);

    ((TextView)findViewById(R.id.title)).setText("gradient shadow"); 
 
    findViewById(R.id.back).setOnClickListener(new OnClickListener() { 
        public void onClick(View v) { 
            ((TextView)findViewById(R.id.title)).setText("loce"); 
        } 
    }); 

because custom title default is fixed you should write yourself theme:

'old > UI Design' 카테고리의 다른 글

Shape  (0) 2010.08.10
shape layout  (0) 2010.08.04
adb shell에서 특정 activity실행하기  (0) 2010.07.06
PowerManager에서 Screen ON/OFF 통지  (0) 2010.07.06
Resources - Menus, Searchable  (0) 2010.07.01
Posted by jazzlife
,

[/data/contact.java]

   // BEGIN: 2010-04-21 lee.hyuntae @btb
    private static final ContentObserver sContactsObserver = new ContentObserver(new Handler()) {
        @Override
        public void onChange(boolean selfUpdate) {
         Log.d("foxil","contactObserver call invalidateCache()");
            invalidateCache();

            if (Log.isLoggable(LogTag.APP, Log.VERBOSE)) {
                log("contact changed, invalidate cache");
            }
        }
    };
    // END: 2010-04-21 lee.hyuntae @btb

   public static void init(final Context context) {
        Cache.init(context);
        RecipientIdCache.init(context);

        // it maybe too aggressive to listen for *any* contact changes, and rebuild MMS contact
        // cache each time that occurs. Unless we can get targeted updates for the contacts we
        // care about(which probably won't happen for a long time), we probably should just
        // invalidate cache peoridically, or surgically.

        // BEGIN: 2010-04-21 lee.hyuntae @btb
        context.getContentResolver().registerContentObserver(
                Contacts.CONTENT_URI, true, sContactsObserver);
     }
     // END: 2010-04-21 lee.hyuntae @btb

; contentResolver에 db를 감시하는 contentObserver 메서드를 사용하면 리스너로 사용할 수 있다.


 

'old > sms_mms' 카테고리의 다른 글

소프트키보드 설정  (0) 2010.03.30
Vcard  (0) 2010.03.09
Posted by jazzlife
,