欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

淺析Activity之間的相互調(diào)用

 更新時(shí)間:2013年06月15日 10:17:55   作者:  
本篇文章是對(duì)android中Activity之間的相互調(diào)用進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
Activity1
復(fù)制代碼 代碼如下:

    //在按鍵按下后,調(diào)用第二個(gè)實(shí)體,第二個(gè)實(shí)體處理完數(shù)據(jù)后再傳給第一個(gè)實(shí)體 
    btn3.setOnClickListener(new Button.OnClickListener() { 
        public void onClick(View v) { 
            final int RG_REQUEST = 0; 
            Intent intent = new Intent(); 
                //作為接受數(shù)據(jù)端 
            intent.setClass(Activity1.this, Activity2.class); 
            startActivityForResult(intent, RG_REQUEST); 
                   /////////////////////  
            } 
        }); 
    } 
    //處理接收的數(shù)據(jù) 
    protected void onActivityResult(int requestCode,int resultCode,Intent data) 
    { 

        super.onActivityResult(requestCode, resultCode, data) 

        if(resultCode==RESULT_OK) 
        { 
            //接收數(shù)據(jù) 
            Bundle bundle =data.getExtras(); 
            double aplpa=bundle.getDouble("aplpa"); 
            String mode=bundle.getString("mode"); 
            String time=bundle.getString("time"); 
        } 
    } 

Activity2
復(fù)制代碼 代碼如下:

    // ////////////////// 
    // 點(diǎn)擊按鍵后,確認(rèn)返回處理 
    // //////////// 
    btn1.setOnClickListener(new Button.OnClickListener() { 
    public void onClick(View arg0) { 
        // TODO Auto-generated method stub 
        Bundle bundle = new Bundle(); 
        bundle.putInt("time", time); 
        bundle.putInt("alpha", aplpa); 
        bundle.putInt("mode", mode); 
        Intent intent = new Intent(Activity2.this,Activity1.class); 
        intent.putExtras(bundle); 
        setResult(RESULT_OK, intent); 
        Activity.this.finish(); 
    } 
    }); 

相關(guān)文章

  • android中LinearLayoutManager一鍵返回頂部示例

    android中LinearLayoutManager一鍵返回頂部示例

    本篇文章主要介紹了android中LinearLayoutManager一鍵返回頂部,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。
    2017-02-02
  • android實(shí)現(xiàn)簡(jiǎn)單儀表盤效果

    android實(shí)現(xiàn)簡(jiǎn)單儀表盤效果

    這篇文章主要為大家詳細(xì)介紹了android實(shí)現(xiàn)簡(jiǎn)單儀表盤效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-05-05
  • Android:控件GridView的使用實(shí)例

    Android:控件GridView的使用實(shí)例

    本篇文章主要介紹了Android:控件GridView的使用實(shí)例,控件GridView是android布局的重要組成,有興趣的可以了解一下。
    2016-12-12
  • Android 實(shí)現(xiàn)微信登錄詳解

    Android 實(shí)現(xiàn)微信登錄詳解

    本文主要介紹Android 微信登錄分享朋友圈,這里給大家詳細(xì)介紹了Android微信登錄的詳細(xì)流程,有需要的小伙伴可以參考下
    2016-07-07
  • Android 中的 Runtime詳解

    Android 中的 Runtime詳解

    Runtime 是 Android 系統(tǒng)中的核心組件之一,它提供了執(zhí)行應(yīng)用程序代碼的環(huán)境,并影響著應(yīng)用程序的性能和響應(yīng)性能,這篇文章主要介紹了Android 中的 Runtime,需要的朋友可以參考下
    2024-01-01
  • Android客戶端與服務(wù)端數(shù)據(jù)加密傳輸方案詳解

    Android客戶端與服務(wù)端數(shù)據(jù)加密傳輸方案詳解

    這篇文章主要為大家介紹了Android客戶端與服務(wù)端數(shù)據(jù)加密傳輸方案詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-01-01
  • Android編程使用android-support-design實(shí)現(xiàn)MD風(fēng)格對(duì)話框功能示例

    Android編程使用android-support-design實(shí)現(xiàn)MD風(fēng)格對(duì)話框功能示例

    這篇文章主要介紹了Android編程使用android-support-design實(shí)現(xiàn)MD風(fēng)格對(duì)話框功能,涉及Android對(duì)話框、視圖、布局相關(guān)操作技巧,需要的朋友可以參考下
    2017-01-01
  • Android APK反編譯技巧深入講解

    Android APK反編譯技巧深入講解

    這篇文章主要給大家介紹了關(guān)于Android APK反編譯技巧的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)各位Android開發(fā)者們具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • Android自定義實(shí)現(xiàn)可滑動(dòng)按鈕

    Android自定義實(shí)現(xiàn)可滑動(dòng)按鈕

    這篇文章主要為大家詳細(xì)介紹了Android自定義實(shí)現(xiàn)可滑動(dòng)的按鈕,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-01-01
  • Android實(shí)現(xiàn)視頻彈幕功能

    Android實(shí)現(xiàn)視頻彈幕功能

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)視頻彈幕功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-11-11

最新評(píng)論