==仅支持 1.5.0 版本以上sdk==
MobileRoute route = MobileRoute.maker("GameBox")
.store();
MobileRoute route = MobileRoute.get("GameBox");
MobileRoute.ViewPoint point = MobileRoute.ViewPoint.maker()
.title("MainActivity");
.property("key1", "value1")
.create();
route.add(point)
route.remove(point)
route.remove(point.getId())
route.clear();
触发提交事件时, 数据中将夹带全路径信息提交
//普通事件提交
MobileEvent.maker()
.route(route.toString())
.commit();
页面显示时提交路径
//Activity
public class MainActivity extends AppCompatActivity {
private MobileRoute mRoute;
private MobileRoute.ViewPoint mPoint;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRoute = MobileRoute.maker("GameBox")
.store();
}
@Override
protected void onResume() {
super.onResume();
mPoint = MobileRoute.ViewPoint.maker()
.title("MainActivity")
.propery("key1", "value")
.create();
mRoute.add(mPoint);
}
@Override
protected void onStop() {
super.onStop();
mRoute.remove(mPoint);
//mRoute.remove(mPoint.getId());
}
}