日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS實現(xiàn)頁面跳轉(zhuǎn)
  1. 打開第一個頁面的“MainAbilitySlice.java”文件,重寫onStart()方法添加按鈕的響應(yīng)邏輯,實現(xiàn)點擊按鈕跳轉(zhuǎn)到下一頁,示例代碼如下:
   package com.example.myapplication.slice;

    
   import com.example.myapplication.ResourceTable;
   import ohos.aafwk.ability.AbilitySlice;
   import ohos.aafwk.content.Intent;
   import ohos.aafwk.content.Operation;
   import ohos.agp.components.*;

    
   public class MainAbilitySlice extends AbilitySlice {

    
       @Override
       public void onStart(Intent intent) {
           super.onStart(intent);
           super.setUIContent(ResourceTable.Layout_main_layout);
           Button button = (Button) findComponentById(ResourceTable.Id_button);

    
           if (button != null) {
               // 為按鈕設(shè)置點擊回調(diào)
               button.setClickedListener(new Component.ClickedListener() {
                   @Override
                   public void onClick(Component component) {
                   Intent secondIntent = new Intent();
                   // 指定待啟動FA的bundleName和abilityName
                   Operation operation = new Intent.OperationBuilder()
                           .withDeviceId("")
                           .withBundleName("com.example.myapplication")
                           .withAbilityName("com.example.myapplication.SecondAbility")
                           .build();
                   secondIntent.setOperation(operation);
                   startAbility(secondIntent); // 通過AbilitySlice的startAbility接口實現(xiàn)啟動另一個頁面
                   }
               });
           }
       }

    
       @Override
       public void onActive() {
           super.onActive();
       }

    
       @Override
       public void onForeground(Intent intent) {
           super.onForeground(intent);
       }
   }

網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了邢臺縣免費建站歡迎大家使用!

  1. 再次運(yùn)行項目,效果如圖所示:

分享名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS實現(xiàn)頁面跳轉(zhuǎn)
URL鏈接:http://m.5511xx.com/article/djesise.html