简体   繁体   English

在某些设备上未正确传递意图额外内容

[英]Intent extras not passed properly on some devices

when i send an Intent from one activity to another (holding some extras), on some devices it does not deliver those extras properly, while in other devices it delivers all the extras (it is the same code on both devices) 当我从一个活动向另一个活动发送一个Intent(持有一些附加功能)时,在某些设备上它无法正确传递这些附加功能,而在其他设备上,它会传递所有附加功能(这在两个设备上都是相同的代码)

this problem happens on android 4.3 on Samsung Note 3 neo 在三星Note 3 Neo的android 4.3上会发生此问题

while i test the same code on Samsung Note Tab 10.1 ... it works fine 当我在Samsung Note Tab 10.1上测试相同的代码时...工作正常

why is that !? 这是为什么 !?

EDIT 编辑

PendingIntent getPendingIntent(){
    Intent extraIntent = getIntentWithExtras();
    Intent mainIntent = new Intent(context, MyActivity.class);
    mainIntent.setAction(MyActivity.ACTION_START_INTENT);
    // add several extras to mainIntent
    addExtras(mainIntent, extraIntent, INTENT_TYPE_ACTIVITY);
    return getActivityPendingIntent(mainIntent,PendingIntent.FLAG_UPDATE_CURRENT);
}

Thanks for your comments, i found out that i'm using these intents in PendingIntents, and while i set the flag of the PendingIntent to 感谢您的评论,我发现我在PendingIntents中使用了这些intent,同时我将PendingIntent的标志设置为

PendingIntent.FLAG_UPDATE_CURRENT

and use the same action ... the intent is not updated and it keeps repeating the first intent 并使用相同的操作...意图没有更新,并且不断重复第一个意图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM