【问题标题】:Ui does not come to foreground on Ice Cream SandwitchUi 在 Ice Cream Sandwich 上没有出现在前台
【发布时间】:2012-04-16 23:48:49
【问题描述】:

我有在冰淇淋三明治诞生之前就可以使用的代码。但似乎现在我对这个孩子有问题。

Intent intent=new Intent(this, com.myUI.class)
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP 
            | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);

顺便说一句,我试图在通话结束后将我的 UI 放在前台。我的应用程序自动拨号并假设在拨号器完成呼叫后显示自己的 UI,或者至少到目前为止它没有任何问题。

伙计们,我做错了什么,我应该怎么做才能解决它?

【问题讨论】:

  • 尝试使用活动管理器将活动推到活动前面。试试这个link

标签: android user-interface android-activity android-4.0-ice-cream-sandwich background-foreground


【解决方案1】:

我有同样的问题,并已更改为下面的代码。看起来效果不错。

PackageManager pm = context.getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(context.getPackageName());
intent.addFlags( Intent.FLAG_ACTIVITY_REORDER_TO_FRONT );
context.startActivity(intent);

希望有帮助

【讨论】:

    猜你喜欢
    • 2012-04-13
    • 1970-01-01
    • 2012-04-01
    • 2012-01-28
    • 2016-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-01
    相关资源
    最近更新 更多