无法打开浏览器

时间:2015-02-16 08:34:50

标签: android android-intent android-service

当我点击键盘锁屏幕上的按钮时,我想打开浏览器。

这是我的代码

public static void startOpenQuotationUrl(Context context, String urlString) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
    Log.v(TAG, "context name:" + context.getClass().getSimpleName());
    intent.setData(Uri.parse(urlString));
    intent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, context.getPackageName());
    context.startActivity(intent);
}

如果浏览器不活动,则打开浏览器是成功的。但是当浏览器进程存在时,它会失败。

这是我的清单的一部分

<application android:label="@string/app_name"
    android:process="com.android.systemui"
    android:persistent="true"
    android:supportsRtl="true">

    <service android:name=".KeyguardService"
        android:exported="true" />
</application>

有什么想法吗?

0 个答案:

没有答案
相关问题