我的意图不启动期望的活动 [英] My intent does not launch desired activity

查看:123
本文介绍了我的意图不启动期望的活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我trrigger和意图如下: -

I trrigger and intent as follows:-

Intent intent = new Intent();
intent.setClassname(packagename, activity path for my activity say 'xyz');
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);

我的活动(XYZ)我已经在其清单文件中导出=真。

for my activity(xyz) i have exported="true" in its manifest file.

但目的不是发动所需的活性(XYZ),只显示我的活动的一个新的窗口标题,然后它显示Settins活动。

but this intent is not launching the desired activity(xyz), it only displays my activity's heading on a new window and then it shows Settins activity.

我不知道问题出在哪里可能。
我的两个活动都在不同的包。
请大家帮忙

I am not sure where the problem might be. Both my activities are in different packages. please help

推荐答案

啊finaly我得到了解决这个..
有一些mislink这是创造的问题。
所以我在我正打算通过有意推出活动AndroidManifest文件添加元数据。

Ahh finaly i got fix for this.. There was some mislink which was creating the problem. So i added meta-data in the AndroidManifest file for the activity which i was intending to launch via the intent.

事情是这样的: -

Something like this:-

<activity android:name="abc$xyz"
    <meta-data android:name="com.vivek.abc.FRAGMENT_CLASS"
        android:value="com.vivek.abc.xyz" />
    <meta-data android:name="com.vivek.abc.PARENT_FRAGMENT_CLASS"
        android:value="the parent activity name" />
</activity>

和这个工作完美的我。

感谢ü所有谁试图帮助:)

Thank u all who tried to help :)

这篇关于我的意图不启动期望的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆