Launch activity when google.com opened in browser - java

I am trying to launch my activity when google.com is navigated to in the browser, but it is not working. Here is my manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myapp.MainActivity"
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>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:scheme="http"
android:host="google.com"/>
</intent-filter>
</activity>
</application>
Anyone see what's wrong?

Related

Android Studio — App not showing up/launching on Android Emulator

I am rather new to Android Studio and needed help as my app couldn't launch in the emulator despite following all the solutions I can find based on others' experiences.
I have 2 activities currently — Main and Login. I will post the AndroidManifest.xml below. Thank you all for the help and time in advanced!! (I also have this message in my event log: Can't bind to local 8700 for debugger)
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:host="ID.firebaseapp.com"
android:scheme="https" />
<category android:name="android.intent.category.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
</activity>
</application>
Solution:
Try this below code:
<activity
android:name=".MainActivity">
<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:host="ID.firebaseapp.com"
android:scheme="https" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Try it ... Hope it helps.
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<data
android:host="ID.firebaseapp.com"
android:scheme="https" />
<!-- <category android:name="android.intent.category.MAIN" /> -->
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
</activity>
</application>
That maybe help you. :)

How to run last viewed activity after resume?

I've got an android application. If I go through activities(for example MainTabActivity->SearchMapActivity->ListBranchesActivity) and then hide(not close) my application, android will run the main (MainTabActivity) activity after reopen. If I press "back" button, android will show me the last activity (ListBranchesActivity). How can I make my app show the last activity after resuming? I really have no idea how to achieve that. Somebody says to add singleTask statement to manifest.
My manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Holo"
android:largeHeap="true" >
<activity
android:name=".SearchMapActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".UpdateActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".CompanyInfoActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".FullMapActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ListBranchesActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ListCompaniesByBranchActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".SearchResultActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainTabActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Also that thing doesn't happen everytime. Sometimes it shows last activity, sometimes - main activity.
> Also that thing doesn't happen everytime. Sometimes
> it shows last activity, sometimes - main activity.
Sometime android closes your app if it needs memory. So even if you hide(not close) ...[the] application, it might have been closed anyway

Phone calls permission

Everybody ask me why my app requires phone calls permission, and I don't know what to say, cause I did not add any phone calls permission to my manifest file. Here are my permissions:
<uses-permission " />
<uses-permission >
<uses-permission " />
<uses-permission >
<uses-permission " />
<uses-permission >
And here's what Google Play says:
THIS APPLICATION HAS ACCESS TO THE FOLLOWING:
NETWORK COMMUNICATION
FULL NETWORK ACCESS
Allows the app to create network sockets and use custom network protocols. The browser and other applications provide means to send data to the internet, so this permission is not required to send data to the internet.
CONNECT AND DISCONNECT FROM WI-FI
Allows the app to connect to and disconnect from Wi-Fi access points and to make changes to device configuration for Wi-Fi networks.
PHONE CALLS
READ PHONE STATUS AND IDENTITY
Allows the app to access the phone features of the device. This permission allows the app to determine the phone number and device IDs, whether a call is active and the remote number connected by a call.
Hide
NETWORK COMMUNICATION
VIEW NETWORK CONNECTIONS
Allows the app to view information about network connections such as which networks exist and are connected.
VIEW WI-FI CONNECTIONS
Allows the app to view information about Wi-Fi networking, such as whether Wi-Fi is enabled and name of connected Wi-Fi devices.
CHANGE NETWORK CONNECTIVITY
Allows the app to change the state of network connectivity.
What's going on here?
EDIT:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="rs.androidaplikacije.flagsandmoney"
android:versionCode="7"
android:versionName="1.3.3" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity
android:name="rs.androidaplikacije.flagsandmoney.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Kviz"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.KVIZ" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.SwarmPopup"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.SWARMPOPUP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Pravila"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.PRAVILA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.NetPopup"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.NETPOPUP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Kviz10Medium"
android:label="#string/app_name" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.KVIZ10MEDIUM" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Kviz20Medium"
android:label="#string/app_name" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.KVIZ20MEDIUM" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Kviz10Hard"
android:label="#string/app_name" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.KVIZ10HARD" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Kviz20Hard"
android:label="#string/app_name" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.KVIZ20HARD" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Kviz20"
android:label="#string/app_name" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.KVIZ20" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Menu"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Izbor"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.IZBOR" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Rezultat"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.REZULTAT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.Prefs"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/PrefsTheme"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.PREFS" />
<category android:name="android.intent.category.DEFAULT"
/>
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.PogresanOdgovor"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.POGRESANODGOVOR" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.TacanOdgovor"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.TACANODGOVOR" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacije.flagsandmoney.RezultatVreme"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacije.flagsandmoney.REZULTATVREME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
public static final String ACCESS_NETWORK_STATE
Added in API level 1
Allows applications to access information about networks
Constant Value: "android.permission.ACCESS_NETWORK_STATE"
From the documentation, this seems to mean ALL networks, including the phone.

Phone calls permissions from nowhere?

So, Google Play reports that my app uses Phone calls permission. So, I had some permissions, mainly for network and internet and I've deleted all of them and I STILL HAVE phone calls permission!! Here's my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="rs.androidaplikacijekvizopstekulture"
android:versionCode="4"
android:versionName="1.1.2">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity
android:name="rs.androidaplikacijekvizopstekulture.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.Menu"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.Izbor"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.IZBOR" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.Pravila"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.PRAVILA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.DvadesetPitanja"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.DVADESETPITANJA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.NeogranicenoPetGresaka"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.NEOGRANICENOPETGRESAKA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.NeogranicenoTriGreske"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.NEOGRANICENOTRIGRESKE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.NeogranicenoJednaGreska"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.NEOGRANICENOJEDNAGRESKA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.Kviz"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.KVIZ" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.Prefs"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.PREFS" />
<category android:name="android.intent.category.DEFAULT"
/>
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.PogresanOdgovor"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.POGRESANODGOVOR" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.SwarmPopup"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.SWARMPOPUP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.NetPopup"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.NETPOPUP" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.Rezultat"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.REZULTAT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.RezultatVreme"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.REZULTATVREME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="rs.androidaplikacijekvizopstekulture.TacanOdgovor"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="rs.androidaplikacijekvizopstekulture.TACANODGOVOR" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
So, apsolutely no permissions in my manifest file, and I still get the Phone calls permission. I DON'T GET IT!
The compiler automatically adds this permission for compatibility reasons if your app use a library designed to run on Android 1.5 or below (because this permission was introduced in Android 1.6).
I guess it's caused by the AdMob library, which still supports Android 1.5.

No Launcher activity found

I can't find any problem but it keep giving me the error "No Launcher activity found!" and "The launch will only sync the application package on the device!"
can anyone solve this problem???
This is my Maniest
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.saikoro.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.saikoro.StartUp"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.saikoro.StartUp" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The <activity> element of the activity you want to launch through the icon on the app list must contain both of the following parts of the intent-filter:
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Your current manifest has an activity with category LAUNCHER and action MAIN, but in different activities. The one with the icon in the app list must have them both.
Change
<action android:name="com.example.saikoro.StartUp" />
with
<action android:name="android.intent.action.MAIN" />

Categories

Resources