代码已经整理好,效果如下图:
图1:
图2:
图3:
地址:https://github.com/geeklx/MyApplication/tree/master/p022_hois
HiosRegister:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
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:
1
2
3
4
5
6
|
//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:
1
2
3
4
5
6
7
|
//hios webview跳转 AdListItem adListItem = new AdListItem();
adListItem.setAid( "1" );
adListItem.setBanner( "imgUrl" );
adListItem.setUrl( "" );
HiosHelper.configWebActivity(WebViewMainActivity. class );
HiosHelper.click(MainActivity. this , adListItem); //
|
方法3:
1
2
3
4
5
6
7
8
9
|
//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)的全部~)未完待续~
本文转自 吴雨声 51CTO博客,原文链接:http://blog.51cto.com/liangxiao/1931731,如需转载请自行联系原作者