首先,我必須承認,我是Android的新手,但我們知道,在Android中,我們無法通過其他應用程序啓動應用程序的私人活動。除非它們在intent-filter
中設置爲android:exported = true,或者它們用於implicit
調用。 ,但我們應該可以從應用程序啓動私人活動。當涉及到瀏覽器(特別是android)時,我們可以使用Intent URLs
來啓動瀏覽器的私人活動。使用意圖URL啓動Android瀏覽器的私人活動
我在Opera Mobile中發現了一些活動,問題是我不能使用Intent URL運行它們,我不知道我在這做什麼錯誤。
例如有在戲曲活動稱爲OperaMainActivity
(或另一個叫OperaStartActivity
)我嘗試啓動它們是這樣的:
intent:#Intent;component=com.opera.browser/com.opera.android.OperaMainActivity;end
或
intent:#Intent;component=com.opera.browser/com.opera.android.OperaStartActivity;end
但這些都不將啓動活動被調用。
但我仍然可以啓動AdMarvelActivity
這是一個私人,以及:
"intent:#Intent;S.url=https://google.com;component=com.opera.browser/com.admarvel.android.ads.AdMarvelActivity;end";
這裏是活動如何OperaMain在AndroidManifest
定義:
<activity ns0:label="@string/app_name_title" ns0:name="com.opera.android.OperaMainActivity" ns0:launchMode="singleTask" ns0:configChanges="keyboard|keyboardHidden|orientation|screenSize" ns0:windowSoftInputMode="10" />
並沒有intent-filter
它。
這是怎麼AdMarvelActivity
在AndroidManifest
定義:
<activity ns0:theme="@*ns0:style/Theme.NoTitleBar.Fullscreen" ns0:name="com.admarvel.android.ads.AdMarvelActivity" ns0:process=":helper" ns0:configChanges="keyboard|keyboardHidden|orientation" />
我看到這兩個的區別並不是很大。我究竟做錯了什麼 ?!
你在找嗎? https://stackoverflow.com/questions/3004515/android-sending-an-intent-to-browser-to-open-specific-url – Shmuel
沒有。它關於啓動瀏覽器的公共活動,可以從其他應用程序調用。即時通訊尋找明確調用隱私瀏覽器本身的私人活動,當然使用意向URL Schemes –