android面試(2)----組件

來源:互聯網
上載者:User

標籤:

1.anroid:id的作用?

android:id是作為控制項的唯一標示符。可以使用與releativelayout中,也可以再Activity中通過findviewbyid來獲得指定的控制項。

2.android:padding 和android:layout_margin的區別。

padding是內部,而margin是外部。

padding 的部分設定background可以覆蓋到,而margin無法覆蓋。

3.Imagebutton & imageview

Imagebutton extern imageview。

4.調用activity的幾種方法?

顯示調用:

Intent intent = new Intent (this,myactivity.class);startActivity(intent);隱示調用Intent intent = new Intent (com.xxx.app.launch);startActivity(intent);

5.avtivity直接如何傳遞資料?

對簡單的通過intent傳遞。

剪貼簿,全域變數,靜態對象等。

6.如何將activity變成對話方塊?

使用theme.dialog來設定activity在androidmanifest.xml的屬性。

7.如何顯示activity過度動畫?

overridependdingTranslation(R.am.fadein, R.am.fadeOut);

8.如何攔截來電?

監聽來電廣播:Telephone.SMS_Received

判斷getcallingstatus:ring。

endcall();

9.如何讓activity開機後顯示?

監聽boot_completed 廣播

在onreceive中

啟動intent:FLAG:intent.setFlag(INTENT_FLAG_NEW_TASK);

10.service 開發AIDL的步驟?

1)在eclipse中建立一個aidl檔案

2)android會自動產生一個*.java檔案。

3)private class ImageSearchBuildServiceImpl extends IBuildService.Stub

建立內部class ImageSearchBuildServiceImpl實現bind的介面。

返回bind的類:

    public IBinder onBind(Intent intent) {        mCurrentCookie = intent.getLongExtra("cookie",-1);        Log.i(TAG, "[onBind] mCurrentCookie:"+mCurrentCookie);        iServiceImpl = new ImageSearchBuildServiceImpl(mImageSearchOperator);        return iServiceImpl;    }

4)在androidmanifest.xml中配置service。

11.AIDL支援那些資料?

AIDL支援java簡單類型(int,char,boolean等)

String和charqueue

List和map

android.os.Pracelable

12.ContentProvider URL有哪幾部分組成?

1)content://

2)authority

3)path

4)param

content://mobile.android.mydata/product/20

 

android面試(2)----組件

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.