검색결과 리스트
안드로이드/android에 해당되는 글 27건
- 2013.03.26 view getId() string 문자 알아보기(EntryName)
- 2013.02.22 GridView stretchMode
- 2013.01.25 shape 레이아웃 모서리 둥글게 하기
- 2013.01.25 배경 이미지 repeat 시키기
- 2013.01.23 통화이력 목록으로 뽑아내기
글
view getId() string 문자 알아보기(EntryName)
View.OnClickListener clickListener = new View.OnClickListener() {
// TODO clickListener
public void onClick(final View v) {
switch (v.getId()) {
case R.id.photo1:
case R.id.photo2:
case R.id.photo3:
Log.i("ID값",v.getResources().getResourceEntryName(v.getId()));
// 결과 photo1, photo2, photo3
break;
}
}
};
'안드로이드 > android' 카테고리의 다른 글
webview 클립보드 (Copy & paste) 에 내용 넣기 (0) | 2013.04.05 |
---|---|
Button drawableLeft 자바에서 설정하기 (0) | 2013.03.27 |
GridView stretchMode (0) | 2013.02.22 |
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
설정
트랙백
댓글
글
GridView stretchMode
android:stretchMode android:numColumns="auto_fit" 으로 지정한 경우 열의 나머지 공간 처리 지정
- android:stretchMode="columnWidth" : 위젯이 격자 내부를 가득채우게 함
- android:stretchMode="spacingWidth" : 남는공간을 여백으로 채움
'안드로이드 > android' 카테고리의 다른 글
Button drawableLeft 자바에서 설정하기 (0) | 2013.03.27 |
---|---|
view getId() string 문자 알아보기(EntryName) (0) | 2013.03.26 |
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
통화이력 목록으로 뽑아내기 (0) | 2013.01.23 |
설정
트랙백
댓글
글
shape 레이아웃 모서리 둥글게 하기
// res/drawable/shape.xml
============================================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#90000000"/>
<stroke android:width="4dp" android:color="#50000000"
android:dashWidth="1dp" android:dashGap="0dp" />
<padding android:left="7dp" android:top="7dp"
android:right="7dp" android:bottom="7dp" />
<corners android:radius="10dp" />
</shape>
<TextView
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="16sp" android:textStyle="bold" android:text="모서리 둥글게 하자" android:textColor="#ffffff"
android:gravity="center" android:background="@drawable/shape"
android:padding="16px"
/>
'안드로이드 > android' 카테고리의 다른 글
view getId() string 문자 알아보기(EntryName) (0) | 2013.03.26 |
---|---|
GridView stretchMode (0) | 2013.02.22 |
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
통화이력 목록으로 뽑아내기 (0) | 2013.01.23 |
특정 전화 번호로 주소록에 등록 되어 있는지 체크하기 (0) | 2013.01.09 |
설정
트랙백
댓글
글
배경 이미지 repeat 시키기
1x1 이미지를 배경으로 반복해서 보이게 하기
====================================================================
// res/drawble/background_image.xml
==================================================================
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/background" android:tileMode="repeat"
/>
// res/layout/background.xml
<LinearLayout android:background="@drawable/background_image.xml" />
=======================================================================
// theme manifest
========================================================================
/res/values/theme.xml
<style name="Theme.BackGround" parent="android:Theme">
<item name="android:windowBackground">@drawable/background</item>
<item name="android:windowNoTitle">true</item>
</style>
/manifest.xml
<activity android:name=".Test" android:label="@string/app_name" android:screenOrientation="landscape"
android:theme="@style/Theme.BackGround" />
'안드로이드 > android' 카테고리의 다른 글
GridView stretchMode (0) | 2013.02.22 |
---|---|
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
통화이력 목록으로 뽑아내기 (0) | 2013.01.23 |
특정 전화 번호로 주소록에 등록 되어 있는지 체크하기 (0) | 2013.01.09 |
Dialog Fullscreen theme (0) | 2013.01.04 |
설정
트랙백
댓글
글
통화이력 목록으로 뽑아내기
private Cursor getContacts(){
/**
* Calls.TYPE {1=>수신,2=>송신,3=>부재중전화,5=>수신거부}
*/
final Uri uri =CallLog.Calls.CONTENT_URI;
String[] projection = {
CallLog.Calls.NUMBER,
CallLog.Calls.TYPE,
CallLog.Calls.CACHED_NAME,
CallLog.Calls.DATE,
CallLog.Calls.DURATION
};
String selection=null;
String[] selectionArgs = null;
String sortOrder=CallLog.Calls.DATE + " DESC";
return managedQuery(uri, projection,selection, selectionArgs, sortOrder);
}
private List<Contact> getContactsList() throws Exception
{
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
contactsList = new ArrayList<Contact>();
cs = getContacts();
contacts_count = cs.getCount();
if(cs.moveToFirst()){
do {
final String nname = cs.getString(2);
String name="";
if(nname!=null && !nname.equals("")){
Log.i("safasfsda",nname);
name=new String(nname.getBytes(), "utf-8");
}
Log.i("getContactsList",
" NUMBER: "+cs.getString(0)+
" TYPE: "+cs.getString(1)+
" CACHED_NAME: "+name+
" DATE: "+dateFormat.format(cs.getLong(3))+
" DURATION: "+cs.getString(4)
);
} while (cs.moveToNext());
}
return contactsList;
}
'안드로이드 > android' 카테고리의 다른 글
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
---|---|
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
특정 전화 번호로 주소록에 등록 되어 있는지 체크하기 (0) | 2013.01.09 |
Dialog Fullscreen theme (0) | 2013.01.04 |
setOnClickListener 온 클릭 이벤트 리스너 listener 사용법 (1) | 2012.12.27 |