My project is a download manager that open a link to download something.
I want to add this feature that when I use chrome Bower and click in a link , my application suggest to user to use it for opening the link.
I used
<category android:name="android.intent.category.DEFAULT"/>
but there is no effect.
here is my manifest:
<application
android:allowBackup="true"
android:icon="#drawable/gigaget"
android:label="#string/app_name">
<activity
android:name=".ui.main.MainActivity"
android:label="#string/app_name"
android:theme="#style/Theme.App.Blue"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="us.shandian.giga.intent.DOWNLOAD"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:mimeType="application/*"
android:host="*"
android:scheme="http"/>
<data
android:mimeType="application/*"
android:host="*"
android:scheme="https"/>
</intent-filter>
</activity>
<activity
android:name=".ui.main.DetailActivity"
android:label="#string/app_name"
android:theme="#style/Theme.App.Blue">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.web.BrowserActivity"
android:label="#string/browser"
android:theme="#style/Theme.App.Blue">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity-alias
android:name=".ui.web.BrowserActivity-share"
android:label="#string/open_with_gigaget"
android:targetActivity=".ui.web.BrowserActivity">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/*"/>
</intent-filter>
</activity-alias>
<activity
android:name=".ui.settings.SettingsActivity"
android:label="#string/settings"
android:theme="#style/Theme.App.Blue">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.nononsenseapps.filepicker.FilePickerActivity"
android:label="#string/app_name"
android:theme="#style/Theme.App.Blue">
</activity>
<service
android:name=".service.DownloadManagerService"/>
</application>
with this permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
why I cant see my application as suggested app for download like the other applications.
any help?
You need to tell android that your app should become part of the chooser
In the manifest you have to declare that you have an activity that can handle the relevant content
<manifest ... >
<application ... >
<activity android:name=".MyDownloadActivity" ...>
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:mimeType="*/*"
android:scheme="file" />
</intent-filter>
<intent-filter > <!-- mime only SEND(_TO) -->
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SENDTO" />
<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.CATEGORY_OPENABLE" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
</application>
Related
I've made an NFC application who can reads NFC tag. It works well. (With all types)
But since yesterday i'm trying to start automatically my app once a NFC tag is maintained against my device.
So i've updated my Manifest :
<activity android:name=".MainActivity" android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="#xml/nfc_tech_filter" />
</activity>
Then, here is my nfc_tech_filter.xml
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.NfcB</tech>
<tech>android.nfc.tech.NfcF</tech>
<tech>android.nfc.tech.NfcV</tech>
<tech>android.nfc.tech.Ndef</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
<tech>android.nfc.tech.MifareClassic</tech>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
</resources>
And surprise, it works only when I hold a NFC Type 2 against my device.
I've try with my appartement key (Mifare Classic) and my bank card (IsoDep), and it doesn't launch my app...
I specify that it works when my app is already started.
Any idea?
EDIT :
This is my Manifest right now :
<activity android:name=".MainActivity" android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="#xml/nfc_tech_filter" />
</activity>
Now, when I pass my bank card, it opens the application but doesn't display any result.
Parcelable[] rawMessages =
intent.getParcelableArrayExtra(NfcAdapter.EXTRA_TAG);
rawMessages variable is NULL after that. Same if I put NfcAdapter.EXTRA_NDEF_MESSAGES
ACTION_TAG_DISCOVERED:
This intent is started if no activities handle the ACTION_NDEF_DISCOVERED or ACTION_TECH_DISCOVERED intents.
https://developer.android.com/guide/topics/connectivity/nfc/nfc
You get this Intent when no others has captured it, so there is something wrong in your setup.
You can capture it explicitly like:
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
</intent-filter>
I'm trying to compile the "deskclock" application from Android, source found here: https://android.googlesource.com/platform/packages/apps/DeskClock/
I've created a new project in the Android SDK, added the files, and updated the references to match the new package name. The application will compile, and install on the emulator, but upon launch it crashes almost immediately with the following error:
05-16 20:53:37.927 2628-2628/com.mycompanyname.builtinclock E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mycompanyname.builtinclock, PID: 2628
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompanyname.builtinclock/com.mycompanyname.builtinclock.deskclock.DeskClock}: android.view.InflateException: Binary XML file line #50: Binary XML file line #50: Error inflating class com.android.deskclock.widget.RtlViewPager
I can't seem to find what is causing this to happen. I've cleaned and rebuilt the project to no effect.
The only major changes I've made to the above source, is to change the company name to match the new package name and update that in each file that references locations to get rid of all the errors it gave before it would compile.
The other big change, was to the build.gradle file, where I removed the datetimepicker entry(couldn't figure out how to get that to compile) and I re-added the appcompat dependencies on the dependencies screen instead.
If someone can help me, by either pointing out what's wrong with the code, or showing me a better way to compile that package, I would be super grateful! My apologies if this comes off as a dumb question.
See below for the two files that were changed.
Here is the gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.mycompanyname.builtinclock"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:gridlayout-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:support-v13:23.4.0'
}
And here is the AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompanyname.builtinclock"
android:versionCode="410" android:versionName="4.1.0">
<original-package android:name="com.android.alarmclock" />
<original-package android:name="com.android.deskclock" />
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<!-- WRITE_SETTINGS is required to record the upcoming alarm prior to L -->
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<!-- READ_PHONE_STATE is required to determine when a phone call exists prior to M -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- READ_EXTERNAL_STORAGE is required to play custom ringtones from the SD card prior to M -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:label="#string/app_label"
android:name=".deskclock.DeskClockApplication"
android:allowBackup="true"
android:backupAgent=".deskclock.DeskClockBackupAgent"
android:fullBackupContent="#xml/backup_scheme"
android:fullBackupOnly="true"
android:icon="#mipmap/ic_launcher"
android:requiredForAllUsers="true"
android:supportsRtl="true">
<provider android:name=".deskclock.provider.ClockProvider"
android:authorities="com.android.mycompanyname.deskclock"
android:exported="false" />
<activity android:name=".deskclock.DeskClock"
android:label="#string/app_label"
android:theme="#style/DeskClockTheme"
android:icon="#mipmap/ic_launcher_alarmclock"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity-alias android:name="DockClock"
android:targetActivity=".deskclock.DeskClock"
android:label="#string/app_label"
android:theme="#style/DeskClockTheme"
android:icon="#mipmap/ic_launcher_alarmclock"
android:launchMode="singleTask"
android:enabled="#bool/config_dockAppEnabled"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.DESK_DOCK" />
</intent-filter>
</activity-alias>
<activity android:name=".deskclock.settings.SettingsActivity"
android:label="#string/settings"
android:theme="#style/SettingsTheme"
android:taskAffinity=""
android:excludeFromRecents="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".deskclock.worldclock.CitySelectionActivity"
android:label="#string/cities_activity_title"
android:theme="#style/CitiesTheme"
android:taskAffinity=""
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name=".deskclock.alarms.AlarmActivity"
android:taskAffinity=""
android:excludeFromRecents="true"
android:theme="#style/AlarmAlertFullScreenTheme"
android:windowSoftInputMode="stateAlwaysHidden"
android:showOnLockScreen="true" />
<activity android:name=".deskclock.ScreensaverActivity"
android:excludeFromRecents="true"
android:taskAffinity=""
android:theme="#style/ScreensaverActivityTheme"
android:configChanges="orientation|screenSize|keyboardHidden|keyboard" />
<receiver android:name=".deskclock.alarms.AlarmStateManager"
android:exported="false">
</receiver>
<service android:name=".deskclock.alarms.AlarmService"
android:exported="false">
</service>
<activity android:name=".deskclock.HandleApiCalls"
android:theme="#android:style/Theme.NoDisplay"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:permission="com.android.alarm.permission.SET_ALARM"
android:taskAffinity="">
<intent-filter>
<action android:name="android.intent.action.SET_ALARM" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DISMISS_ALARM" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SNOOZE_ALARM" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SHOW_ALARMS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SET_TIMER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
</activity>
<activity-alias android:name="HandleSetAlarm"
android:targetActivity=".deskclock.HandleApiCalls"
android:exported="true">
</activity-alias>
<activity android:name=".deskclock.HandleDeskClockApiCalls"
android:theme="#android:style/Theme.NoDisplay"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:permission="com.android.alarm.permission.SET_ALARM"
android:taskAffinity="">
<intent-filter>
<action android:name="com.android.deskclock.action.SHOW_CLOCK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.ADD_CLOCK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.DELETE_CLOCK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.START_TIMER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.RESET_TIMER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.PAUSE_TIMER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.SHOW_TIMERS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.DELETE_TIMER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.SHOW_STOPWATCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.START_STOPWATCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.PAUSE_STOPWATCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.LAP_STOPWATCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.deskclock.action.RESET_STOPWATCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
</activity>
<receiver android:name="deskclock.AlarmInitReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.TIME_SET" />
<action android:name="android.intent.action.TIMEZONE_CHANGED" />
<action android:name="android.intent.action.LOCALE_CHANGED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<receiver
android:name="com.mycompanyname.builtinclock.alarmclock.AnalogAppWidgetProvider"
android:icon="#mipmap/ic_launcher_alarmclock"
android:label="#string/analog_gadget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data
android:name="android.appwidget.oldName"
android:value="com.android.deskclock.AnalogAppWidgetProvider"/>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/analog_appwidget"/>
</receiver>
<receiver
android:name="com.mycompanyname.builtinclock.alarmclock.DigitalAppWidgetProvider"
android:icon="#mipmap/ic_launcher_alarmclock"
android:label="#string/digital_gadget">
<intent-filter>
<action android:name="android.intent.action.TIME_SET"/>
<action android:name="android.intent.action.SCREEN_ON"/>
<action android:name="android.intent.action.DATE_CHANGED"/>
<action android:name="android.intent.action.LOCALE_CHANGED"/>
<action android:name="android.intent.action.TIMEZONE_CHANGED"/>
<action android:name="com.android.deskclock.DIGITAL_WIDGET_CHANGED"/>
<action android:name="com.android.deskclock.ON_QUARTER_HOUR"/>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
<action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED"/>
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/digital_appwidget"/>
</receiver>
<service android:name="com.mycompanyname.builtinclock.alarmclock.DigitalAppWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS"
android:exported="false" />
<!-- Dream (screensaver) implementation -->
<service android:name="deskclock.Screensaver"
android:exported="true"
android:label="#string/app_label"
android:permission="android.permission.BIND_DREAM_SERVICE">
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<action android:name="android.app.action.NEXT_ALARM_CLOCK_CHANGED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.service.dream"
android:resource="#xml/dream_info" />
</service>
<!-- Settings activity for screensaver -->
<activity android:name=".deskclock.settings.ScreensaverSettingsActivity"
android:label="#string/screensaver_settings"
android:theme="#style/SettingsTheme"
android:taskAffinity=""
android:excludeFromRecents="true"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name=".deskclock.AlarmSelectionActivity"
android:label="#string/dismiss_alarm"
android:theme="#android:style/Theme.Holo.Light.Dialog.NoActionBar"/>
<!-- This activity displays only the timers that have expired with only a reset button
present. This makes the activity appropriate for display above the lock screen so that
users have the limited ability to silence expired timers but nothing else. -->
<activity android:name=".deskclock.timer.ExpiredTimersActivity"
android:excludeFromRecents="true"
android:theme="#style/ExpiredTimersActivityTheme"
android:launchMode="singleInstance"
android:showOnLockScreen="true"
android:taskAffinity=""
android:configChanges="screenSize|keyboardHidden|keyboard|navigation"/>
<!-- Legacy broadcast receiver that honors old scheduled timers across app upgrade. -->
<receiver android:name="deskclock.timer.TimerReceiver"
android:exported="false">
<intent-filter>
<action android:name="times_up" />
</intent-filter>
</receiver>
<service android:name=".deskclock.timer.TimerService"
android:exported="false"
android:description="#string/timer_service_desc">
</service>
<service android:name=".deskclock.stopwatch.StopwatchService"
android:exported="false"
android:description="#string/stopwatch_service_desc">
</service>
</application>
In your layout xml file, you are still using the class com.android.deskclock.widget.RtlViewPager. As you changed the package name, you need to change the same in xml file as well
I have my application and I would like to have two different launchers that each launch different activities. They should all be bundled into one apk and not two separate applications. I know this is possible, example in the XKCD Browser on the Google play store. I have already tried implementing this segment in the second activity I need to be in the launcher:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
This results in the first activity declared as MAIN to be launched when clicking the second launcher. I have also tried:
<intent-filter>
<action android:name="android.intent.action.ACTIVITY_NAME"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
As well as:
<intent-filter>
<action android:name=ACTIVITY_NAME"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Which achieves the same result. I need this to function down to API 17. Ideas?
You should have a main activity with:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
And any other activity with only the category part:
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Maybe you need to put the same date frome place where your call intent for start app
<activity
android:name="com.spectrum.media.activity.InitializationScreen"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MUSIC_PLAYER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.APP_MUSIC" />
<action android:name="android.intent.action.MEDIA_BUTTON" />
<action android:name="android.media.AUDIO_BECOMING_NOISY" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/itunes" />
</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" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/itunes" />
</intent-filter>
<intent-filter android:priority="-1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/itunes" />
</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" />;-->
</intent-filter>
</activity>
And parse this scheme in first activity and run others if necessary.
I am new to android so I want to change the starting of the application in android manifest but each time the application is stopped cs worked is that we must change the java codes aussie
here is the xml code:
<application
android:icon="#drawable/icon"
android:label="hello">
<activity
android:name=".activity.ServersActivity"
android:label="#string/app_name"
android:launchMode="standard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.AddServerActivity"
android:label="#string/add_server_label">
<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="irc"/>
</intent-filter>
</activity>
For setting the starting activity, you'll have to add the following Intent Filter to the activity in your AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Please note that you should only add this Intent Filter to one of your Activities. Otherwise, you might experience unexpected behaviours.
There is no way to change the starting activity by code.
Cut this line and paste it inside activity tag to whom you want as starting activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
For eg: Making AddServerActivity as stating activity
<activity
android:name=".activity.ServersActivity"
android:label="#string/app_name"
android:launchMode="standard">
</activity>
<activity
android:name=".activity.AddServerActivity"
android:label="#string/add_server_label">
<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="irc"/>
</intent-filter>
</activity>
I am just learning how to program apps for android, so please bear with me. My original starting activity was called Menu.Java. When I tested the app on my phone, a launcher icon would show up and I could launch the app from it. I decided to add a different Activity for my start up, which is called Login.java. I changed the intents to .MAIN and .LAUNCHER and now my icon won't show up at all. I tried switching it back to the Menu.Java and that worked for a bit (but clicking the icon would load the Menu Activity, and I was wanting the Login Activity loaded), but now that doesn't even work.
EDIT: I have also removed all of the activities from the manifest except the .Login Activity. Did not work.
Here is my Manifest:
`
<application
android:icon="#+drawable/ic_squirrel"
android:label="#string/app_name" >
<activity android:name="com.example.advanced.Login" >
<intent-filter>
<action android:name="com.example.advanced.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Settings"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.InternalStore"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.INTERNALSTORE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Reading"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.READING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Passing"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.PASSING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.advanced.Numbers"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.advanced.NUMBERS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
`
<activity android:name="com.example.advanced.Login" >
<intent-filter>
<action android:name="com.example.advanced.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Here change the <intent-filter> to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>