小编GvS*_*rma的帖子

如何从Android应用程序中隐藏Google Chrome中的网页

我花了很多时间在这上面并且无法弄清楚这一点.

我需要以隐身模式启动Chrome浏览器.

我的代码:

    private void launchBrowser() {
    String url = "http://foyr.com";
    Intent launchGoogleChrome = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    launchGoogleChrome.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    launchGoogleChrome.setPackage("com.android.chrome");
    try {
        startActivity(launchGoogleChrome);
    } catch (ActivityNotFoundException e) {
        launchGoogleChrome.setPackage(null);
        startActivity(launchGoogleChrome);
    }
}
Run Code Online (Sandbox Code Playgroud)

我发现了几个帖子,但无法找到解决方案. 这里

这个链接给了我一些关于隐身模式的想法,但我也试过这个.

    private void launchBrowser() {
    String url = "http://foyr.com";
    Intent launchGoogleChrome = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    launchGoogleChrome.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    launchGoogleChrome.setPackage("com.android.chrome");
    launchGoogleChrome.putExtra("com.android.chrome.EXTRA_OPEN_NEW_INCOGNITO_TAB", true);
    try {
        startActivity(launchGoogleChrome);
    } catch (ActivityNotFoundException e) {
        launchGoogleChrome.setPackage(null);
        startActivity(launchGoogleChrome);
    }
}
Run Code Online (Sandbox Code Playgroud)

但Chrome浏览器没有从应用程序接收任何意图信息.任何人都可以帮助我哪里出错了,该怎么办?

java android google-chrome

7
推荐指数
1
解决办法
1852
查看次数

在android中给出inputType时,Min Lines不工作

任何人都遇到过这种情况.我需要为edittext显示最少4行,当minLines给出itworks时,但是当添加inputType标签时,Min Lines失败..

          <EditText
                android:id="@+id/my_review_review_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:inputType="textCapSentences|textAutoCorrect"
                android:background="@drawable/rect"
                android:gravity="top|left"
                android:hint="Add a review"
                android:maxLines="5"
                android:minLines="4"
                android:padding="10dp" />
Run Code Online (Sandbox Code Playgroud)

如果我错了请纠正我并给我一个解决方案....

android android-edittext

6
推荐指数
1
解决办法
2873
查看次数

标签 统计

android ×2

android-edittext ×1

google-chrome ×1

java ×1