当前位置: 首页>>代码示例>>Java>>正文


Java XGPushManager.onActivityStarted方法代码示例

本文整理汇总了Java中com.tencent.android.tpush.XGPushManager.onActivityStarted方法的典型用法代码示例。如果您正苦于以下问题:Java XGPushManager.onActivityStarted方法的具体用法?Java XGPushManager.onActivityStarted怎么用?Java XGPushManager.onActivityStarted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.tencent.android.tpush.XGPushManager的用法示例。


在下文中一共展示了XGPushManager.onActivityStarted方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onStart

import com.tencent.android.tpush.XGPushManager; //导入方法依赖的package包/类
@Override
    protected void onStart() {
        super.onStart();

        XGPushClickedResult result = XGPushManager.onActivityStarted(this);
        if (result != null) {
            String custom = result.getCustomContent();
            if (custom != null && !custom.isEmpty()) {
                try {
                    JSONObject json = new JSONObject(custom);
                    String url = json.getString("param_url");

//                    Intent mainIntent = new Intent(this, MainActivity_.class);
//                    mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//                    mainIntent.putExtra("mPushUrl", url);
//                    startActivity(mainIntent);

                    Intent resultIntent = new Intent(MyPushReceiver.PushClickBroadcast);
                    resultIntent.setPackage("net.coding.program");
                    resultIntent.putExtra("data", url);
                    sendBroadcast(resultIntent);
                    finish();

                } catch (Exception e) {
                    Global.errorLog(e);
                }
            }
        }
    }
 
开发者ID:huang303513,项目名称:Coding-Android,代码行数:30,代码来源:EntranceActivity.java

示例2: onResume

import com.tencent.android.tpush.XGPushManager; //导入方法依赖的package包/类
@Override
protected void onResume() {
    Log.i(tag,"onResume");
    super.onResume();
    XGPushClickedResult click = XGPushManager.onActivityStarted(this);
    Log.i(tag, "onResumeXGPushClickedResult:" + click);
    if (click != null) { // 判断是否来自信鸽的打开方式
        Toast.makeText(this, "通知被点击:" + click.toString(), Toast.LENGTH_SHORT).show();
        Log.i(tag,"通知被点击:" + click.toString());
    }
}
 
开发者ID:bangqu,项目名称:eshow-android,代码行数:12,代码来源:MainActivity.java

示例3: configure

import com.tencent.android.tpush.XGPushManager; //导入方法依赖的package包/类
public boolean configure(Long accessId,String accessKey,boolean debug,final CallbackContext callbackContext) {
	XGPushConfig.setAccessId(this.cordova.getActivity(), accessId);
	XGPushConfig.setAccessKey(this.cordova.getActivity(), accessKey);
	XGPushConfig.enableDebug(this.cordova.getActivity(), debug);
	XGPushManager.onActivityStarted(this.cordova.getActivity());
	callbackContext.success();
	return true;
}
 
开发者ID:zhihuwang,项目名称:xinge-cordova,代码行数:9,代码来源:Xinge.java

示例4: onCreate

import com.tencent.android.tpush.XGPushManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_show_luntan);
    instance=this;
    users = SaveUserUtil.loadAccount(this);
    result = XGPushManager.onActivityStarted(ShowLuntanActivity.this);
    if (result != null) {
        xg_bool = true;
        // 获取自定义key-value
        String customContent = result.getCustomContent();
        if (customContent != null && customContent.length() != 0) {
            try {
                JSONObject obj = new JSONObject(customContent);
                // key1为前台配置的key
                if (!obj.isNull("data")) {
                    news_luntan = new News_luntan();
                    String data = obj.getString("data");
                    JSONObject object = new JSONObject(data);
                    User userr = new User();
                    userr.setUser(object.getString("user"));
                    userr.setNickname(object.getString("nickname"));
                    userr.setIcon(object.getString("icon"));
                    userr.setSex(object.getString("sex"));
                    news_luntan.setUser(userr);
                    news_luntan.setLid(object.getInt("lid"));
                    news_luntan.setContent(object.getString("content"));
                    news_luntan.setImage(object.getString("image"));
                    news_luntan.setTime(object.getString("time"));
                    news_luntan.setLocation(object.getString("location"));


                }
                // ...
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    } else {
        intent = getIntent();
        news_luntan = (News_luntan) intent.getSerializableExtra("news_luntan");

    }


    initialView();

}
 
开发者ID:jiangzehui,项目名称:xmpp,代码行数:49,代码来源:ShowLuntanActivity.java

示例5: onStart

import com.tencent.android.tpush.XGPushManager; //导入方法依赖的package包/类
@Override
protected void onStart() {
	super.onStart();
	XGPushManager.onActivityStarted(this);
}
 
开发者ID:V5KF,项目名称:V5KFClientSDK-Android,代码行数:6,代码来源:MainActivity.java


注:本文中的com.tencent.android.tpush.XGPushManager.onActivityStarted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。