Intent过滤器可浏览不起作用

时间:2015-12-14 10:17:19

标签: android intentfilter

这是我的意图但不起作用。所有浏览器都启动但我的应用程序不在列表中,这是我的清单:

Spatial_object

2 个答案:

答案 0 :(得分:1)

试试这个:

               <activity
                    android:name=".MainActivity"
                    android:configChanges="orientation|keyboardHidden"
                    android:label="@string/app_name"
                    android:screenOrientation="portrait"
                    android:windowSoftInputMode="adjustPan">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                        <action android:name="android.intent.action.VIEW" />
                        <category android:name="android.intent.category.DEFAULT" />
                        <category android:name="android.intent.category.BROWSABLE" />
                        <data android:scheme="http" android:host="www.googal.com" />
                    </intent-filter>
                    <intent-filter>
                        <action android:name="android.intent.action.VIEW" />
                        <category android:name="android.intent.category.DEFAULT" />
                        <category android:name="android.intent.category.BROWSABLE" />
                        <data android:scheme="http" android:host="www.googal.com" />
                    </intent-filter>
                </activity>

答案 1 :(得分:1)

试试这种方式。

/* Constructor */
public Trie() {
    root = new TrieNode("", "");
}

public void insertWord(String sourceWords, String targetWords) {
    if (searchWord(sourceWords) == true)
        return;
    TrieNode current = root;

    String[] sourceArray = sourceWords.split(":");
    String[] targetArray = targetWords.split(":");

    for (int i = 0; i < sourceArray.length; i++) {
        TrieNode child = current.subNodeWord(sourceArray[i]);
        if (child != null) {
            current = child;
        } else {
            current.childList.add(new TrieNode(sourceArray[i],
                    targetArray[i]));
            current = current.subNodeWord(sourceArray[i]);
        }
        current.count++;
    }
    current.isEnd = true;
}

public boolean searchWord(String words) {
    TrieNode current = root;
    for (String word : words.split(":")) {
        if (current.subNodeWord(word) == null) {
            return false;
        } else {
            current = current.subNodeWord(word);
        }
    }

    if (current.isEnd == true)
        return true;
    return false;
}

public Queue<TrieNode> bfsTraversal(TrieNode node) {
    // TODO need to add logic for bfs/dfs for traversing the trie
    Queue<TrieNode> queue = new LinkedList<>();
    Queue<TrieNode> tempQueue = new LinkedList<>();
    queue.add(root);
    while (!queue.isEmpty()) {
        TrieNode tempNode = queue.poll();
        tempQueue.add(tempNode);
        int counter = tempNode.childList.size(), i = 0;
        if (tempNode == null)
            break;
        if (!tempNode.source.isEmpty())
            System.out.println("Source :" + tempNode.source
                    + "     Target : " + tempNode.target);
        while (i < counter) {
            queue.add(tempNode.childList.get(i++));
        }
    }
    tempQueue.poll();
    return tempQueue;
}