本文整理汇总了Java中com.baidu.mobstat.StatService类的典型用法代码示例。如果您正苦于以下问题:Java StatService类的具体用法?Java StatService怎么用?Java StatService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StatService类属于com.baidu.mobstat包,在下文中一共展示了StatService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.baidu.mobstat.StatService; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.common_recycler_status, container, false);
ButterKnife.bind(this, rootView);
StatService.onEvent(getContext(), "tv_query_1", "pass", 1);
status.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
presenter.query();
}
});
presenter = new TvPresenter(this);
presenter.query();
return rootView;
}
示例2: onListItemClick
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void onListItemClick(ListView l, View v, int position, long id){
RebateItem item = this.adapter.getItem(position);
String shortKey = item.shortKey;
String numIid = item.numIId + "";
Log.d("emop", "onItemClick, id:" + id + ", short key:" + shortKey);
if(shortKey != null && shortKey.length() > 0){
StatService.onEvent(getActivity(), "go_rebate", numIid + "_" + shortKey + "_" + client.userId, 1);
String url = "http://c.emop.cn/c/" + shortKey + "?from=app&auto_mobile=n";
Intent intent = new Intent().setClass(getActivity(), WebViewActivity.class);
intent.putExtra("http_url", url);
intent.putExtra("taoke_num_iid", numIid);
startActivity(intent);
}
}
示例3: goBuy
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void goBuy(){
if(shortKey != null && shortKey.length() > 0){
String url = "http://c.emop.cn/c/" + shortKey + "?from=app";
if(fromMobile){
url += "&auto_mobile=n";
}else {
url += "&auto_mobile=y";
}
StatService.onEvent(getActivity(), "go_shop", shopId + "_" + shortKey, 1);
Intent intent = new Intent().setClass(getActivity(), WebViewActivity.class);
intent.putExtra("http_url", url);
this.startActivity(intent);
}else {
showToast("链接出错无法购买。");
}
}
示例4: onResume
import com.baidu.mobstat.StatService; //导入依赖的package包/类
protected void onResume (){
super.onResume();
StatService.onResume(this);
isRunning = true;
client.appImgLoader.clear();
MainTabActivity tab = (MainTabActivity)this.getParent();
if(tab != null){
if(tabIndex < 0){
tabIndex = tab.tabHost.getCurrentTab();
Log.d("emop", "save cur tab index:" + tabIndex);
}else {
Log.d("emop", "update tab to:" + tabIndex);
tab.activeTab(tabIndex);
}
}
}
示例5: doKeywordSearch
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void doKeywordSearch(View v){
TextView text = (TextView)this.findViewById(R.id.search_keyword);
String keyword = text.getText().toString();
if(keyword.trim().length() > 0){
String searchUrl = String.format("http://s.m.taobao.com/search.htm?q=%s&pid=mm_%s_0_0",
Uri.encode(keyword), client.trackPID);
StatService.onEvent(this, "search", keyword + "_" + client.trackPID + "_" + client.userId, 1);
Intent intent = new Intent().setClass(this, WebViewActivity.class);
intent.putExtra("http_url", searchUrl);
intent.putExtra("title", keyword);
this.startActivity(intent);
}else {
showToast("请输入需要搜索的关键词。");
}
}
示例6: onCreate
import com.baidu.mobstat.StatService; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
StatService.setDebugOn(true);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
initUI();
//throw new NullPointerException();
}
示例7: onCreateView
import com.baidu.mobstat.StatService; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_mobile_info, container, false);
ButterKnife.bind(this, rootView);
StatService.onEvent(getContext(), "local_info", "pass", 1);
listView.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, properties));
return rootView;
}
示例8: onBindViewHolder
import com.baidu.mobstat.StatService; //导入依赖的package包/类
@Override
public void onBindViewHolder(final TvViewHolder holder, int position) {
holder.setText(list.get(position).name);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
StatService.onEvent(context, "tv_query_2", "pass", 1);
Intent intent = new Intent(context, TvChannelActivity.class);
intent.putExtra(TvChannelActivity.TV_CATEGORY_INTENT, list.get(holder.getAdapterPosition()));
context.startActivity(intent);
}
});
}
示例9: goShopBuy
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void goShopBuy(){
if(shopId != null && shopId.length() > 1 && shopId.length() < 10 && loaded){
String url = String.format("http://shop%s.taobao.com/", shopId);
if(shortUrl != null && shortUrl.length() > 0){
url = "http://c.emop.cn/c/" + shortUrl + "?from=app";
}
StatService.onEvent(getActivity(), "go_shop", shopId + "_" + "no_short", 1);
Intent intent = new Intent().setClass(getActivity(), WebViewActivity.class);
intent.putExtra("http_url", url);
this.startActivity(intent);
}else {
Toast.makeText(getActivity(), "店铺信息加载中,稍后再试。", Toast.LENGTH_SHORT).show();
}
}
示例10: onCreate
import com.baidu.mobstat.StatService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.guang_item_list_view);
Intent intent = this.getIntent();
dataUri = intent.getData();
String title = intent.getStringExtra("title");
if(title != null && title.trim().length() >0){
TextView v = (TextView)findViewById(R.id.title);
v.setText(title);
}
initWaterFallLayout();
waterfallView.showHeadLoader();
errorView = (LinearLayout)this.findViewById(R.id.error_view);
List<String> seg = dataUri.getPathSegments();
if(seg.size() > 2){
StatService.onEvent(this, seg.get(0) + "_" + seg.get(1), "view", 1);
}
View tab = findViewById(R.id.nav_fav_tabs);
if(tab != null){
tab.setVisibility(View.GONE);
}
}
示例11: goBuy
import com.baidu.mobstat.StatService; //导入依赖的package包/类
private void goBuy(){
StatService.onEvent(this, "go_taobao", numId + "_" + shortKey + "_" + client.userId, 1);
String url = "http://c.emop.cn/c/" + shortKey + "?from=app";
if(fromMobile){
url += "&auto_mobile=n";
}else {
url += "&auto_mobile=y";
}
Intent intent = new Intent().setClass(this, WebViewActivity.class);
intent.putExtra("http_url", url);
intent.putExtra("taoke_num_iid", numId);
this.startActivity(intent);
}
示例12: onShareToWeibo
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void onShareToWeibo(View v){
String trackId = "0";
if(client.trackUserId != null && client.trackUserId.trim().length() > 0){
trackId = client.trackUserId;
}
String link = String.format(Constants.WEB_LINK, trackId, weiboId, shortKey);
StatService.onEvent(TaokeItemDetailActivity.this, "share_to_wx", numId + "_" + shortKey + "_" + client.userId, 1);
Intent intent = new Intent();
intent.setClass(this, ShareToWeiboActivity.class);
intent.putExtra("text", text);
intent.putExtra("link", link);
intent.putExtra("picUrl", this.picUrl);
startActivity(intent);
}
示例13: onResume
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void onResume() {
super.onResume();
System.out.println("FragmentDemoActivity-->onResume");
/**
* 页面起始(注意: 每个Activity中都需要添加,如果有继承的父Activity中已经添加了该调用,那么子Activity中务必不能添加)
* 如果该FragmentActivity包含了几个全页面的fragment,那么可以在fragment里面加入就可以了,这里可以不加入。如果不加入将不会记录该Activity页面。
*/
StatService.onResume(this);
}
示例14: onPause
import com.baidu.mobstat.StatService; //导入依赖的package包/类
public void onPause() {
super.onPause();
System.out.println("FragmentDemoActivity-->onPause");
/**
* 页面结束(注意: 每个Activity中都需要添加,如果有继承的父Activity中已经添加了该调用,那么子Activity中务必不能添加)
* 如果该FragmentActivity包含了几个全页面的fragment,那么可以在fragment里面加入就可以了,这里可以不加入。如果不加入将不会记录该Activity页面。
*/
StatService.onPause(this);
}
示例15: onResume
import com.baidu.mobstat.StatService; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
StatService.onResume(this);
}