Intent filter browsable not work - android

This is my intent but not work. All browser start but my app is not in list, this is my Manifest:
<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" />
</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" android:path="/*" />
</intent-filter>
</activity>

Try This:
<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>

Try this way.
<data android:scheme="http" />
<data android:host="www.googal.com" />
<data android:pathPrefix="/"/>

Related

I am creating a Browser App but Android won't detect my app in chooser while I click on any URL

I am creating a Browser app and I want Android to treat my app as a browser and show up in the app chooser to open with.
I want my app to show up in this list.
Here is my manifest Activity code:
<activity
android:name=".Activity.LinkDetectorActivity"
android:exported="true"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="testscheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Replace your intent-filter with below,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http"/>
<category android:name="android.intent.category.DEFAULT" />
<!-- The BROWSABLE category is required to get links from web
pages. -->
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Try to change testcheme to "http" and "https"
<activity
android:name=".Activity.LinkDetectorActivity"
android:exported="true"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="http" />
<data android:scheme="https" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Not opening share activity

I want to receive data from other apps. I have ShareActivity class and added it to AndroidManifest but i can't show my app to the share apps list. Please help.
<activity
android:name=".share.ShareActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:noHistory="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="text/plain" />
<data android:mimeType="video/*" />
<data
android:host="www.youtube.com"
android:mimeType="text/*"
android:scheme="https" />
</intent-filter>
</activity>
=============================== EDIT =======================================
Only i removed this line and it worked:
<data
android:host="www.youtube.com"
android:mimeType="text/*"
android:scheme="https" />
specifies Your intent-filter like below code
Try this
<activity android:name=".share.ShareActivity"
android:name=".share.ShareActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:noHistory="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
for information read here

Control multiple activity intents in android

I am trying to open my app depending on the url that is entered but in some cases it tries to execute several activities at the same time, is there any way to restrict this so that the MainAction does not execute when trying to execute another?, basically my manifest goes like this
Main Activity
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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" />
<data android:scheme="https" />
<data android:host="www.test.com" />
<data android:host="m.test.com" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="home"
android:scheme="testapp" />
</intent-filter>
</activity>
Detail Activity
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:launchMode="singleInstance"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="detail"
android:scheme="testapp" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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" />
<data android:scheme="https" />
<data android:host="www.test.com" />
<data android:host="m.test.com" />
<data android:pathPrefix="/homes"/>
</intent-filter>
</activity>
the problem is that when i try to open a link like "http://www.test.com/homes" this happens:
Your DetailActivity should be declared as shown below, no intent filter is needed.
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:theme="#style/AppTheme.NoActionBar">
</activity>
The thing that matters is the launchMode for the MainActivity
You should read that : https://developer.android.com/guide/topics/manifest/activity-element.html#lmode

Why icon don't appear on Android Galaxy S6 and S7?

I have a problem without logic, my application run smoothly on almost all devices but when I try the Samsung Galaxy S6 and S7 models, simply icon does not appear anywhere.
I've tried to send the official store (still the same)
If I run via simulator the application opens, but without the icon (shortcut).
My AndroidManifest.xml
[...]
<application
android:name="MyApp"
android:label="MyApp"
android:icon="#mipmap/ic_launcher_phone"
android:hardwareAccelerated="true"
android:supportsRtl="true">
<activity android:name=".MyAppTalk"
android:label="MyApp"
android:theme="#style/MyAppTheme"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:icon="#mipmap/ic_launcher_phone"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden|adjustNothing">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="tel" />
</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" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:mimeType="vnd.android.cursor.dir/calls" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<!-- This was never intended to be public, but is here for backward
compatibility. Use Intent.ACTION_DIAL instead. -->
<intent-filter>
<action android:name="com.android.phone.action.TOUCH_DIALER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.TAB" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="#string/recentCallsIconLabel">
<action android:name="com.android.phone.action.RECENT_CALLS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.TAB" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.android.keyguard.layout"
android:resource="#layout/keyguard_preview" />
</activity>
[...]
I added several "android.intent.category.LAUNCHER" as despair,
Thanks

My Android App is not showing on the App Drawer

I have an application with a single activity:
<activity android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:launchMode="singleTask"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="com.google.intent.category.CARDBOARD" />
<data android:scheme="myscheme" android:host="action1"/>
<data android:scheme="myscheme" android:host="action2"/>
<data android:scheme="myscheme" android:host="action3"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
I need it to respond to myscheme:// urls, and it is working in that regard. Unfortunately, it does not show in my App Drawer. If I remove the android:scheme lines, then it shows on the App Drawer, but then it no longer responds to myscheme:// urls, obviously.
How can I fix this activity to make it both show on the app drawer and respond to the custom urls?
Try splitting the intent-filter into two:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<category android:name="com.google.intent.category.CARDBOARD" />
<data android:scheme="myscheme" android:host="action1"/>
<data android:scheme="myscheme" android:host="action2"/>
<data android:scheme="myscheme" android:host="action3"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

Categories

Resources