代码已经整理好,效果如下图:
图1:
图2:
图3:
地址:https://github.com/geeklx/MyApplication/tree/master/p022_hois
HiosRegister:
package com.example.p022_hois.hioscommon; import com.example.p022_hois.hoisjump.HiosAlias; public class HiosRegister { private static final String PKG_SFNATION = "com.example.p022_hois"; public static void load() { HiosAlias.register("jump.twomainactivity", PKG_SFNATION, ".activity.TwoMainActivity"); HiosAlias.register("jump.webviewmainactivity", PKG_SFNATION, ".activity.WebViewMainActivity"); } }
方法1:
//hios activity跳转 AdListItem adListItem = new AdListItem(); adListItem.setAid("1"); adListItem.setBanner("imgUrl"); adListItem.setUrl("hios://jump.twomainactivity"); HiosHelper.click(MainActivity.this, TwoMainActivity.class, adListItem);// 第一个是当前Activity 第二个是Fragment
方法2:
//hios webview跳转 AdListItem adListItem = new AdListItem(); adListItem.setAid("1"); adListItem.setBanner("imgUrl"); adListItem.setUrl(""); HiosHelper.configWebActivity(WebViewMainActivity.class); HiosHelper.click(MainActivity.this, adListItem);//
方法3:
//hios activity跳转 AdListItem adListItem = new AdListItem(); adListItem.setAid("1"); adListItem.setBanner("imgUrl"); adListItem.setUrl("hios://jump.twomainactivity?sku_id={s}1000252");//带参数 HiosHelper.click(MainActivity.this, TwoMainActivity.class, adListItem);// 第一个是当前Activity 第二个是Fragment //TwoMainActivity接收 mAlertSkuId = getIntent().getStringExtra("sku_id");
总结:还有两个内容还没写出来,这里面有webview的base类经历过洗礼,大家可以用~(爱一个人就要爱他(loader)的全部~)未完待续~
时间: 2024-10-29 19:11:23