- If the intent filters are to resolve implicit intents, then why does the MainActivity(which is the very first activity that is run when app is launched) has an intent filter?
- Who send an implicit intent to it?
- What if the sent implicit intent doesn't have proper data ?
Why does the Main activity has an intent filter?
851 Views Asked by sofs1 At
2
There are 2 best solutions below
4
Gabe Sechan
On
Well, how does the system know which activity is the main activity? It isn't the name- the system doesn't care about the name. Its the activity with the intent filter that says its the main activity.
It can also have other intent filters to launch it any other way you may want. For example, you may have an intent filter to launch it via a deep link.
As for proper data- if launched from the app list or homescreen, it won't have any data. Its on the programmer of the app to make sure that it can do something that makes sense in that case.
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in ANDROID-STUDIO
- how do i submit a pastebin or pastee from an android app and get the url back
- Getresource id Error
- Call special fragment in Navigation Drawer Activity from separate Activity
- Debug native code in Android Studio
- How to introduce in this AlertDialog a onBackButtonPressed method?
- Android Studio : All of a sudden cannot resolve symbol 'ActionBarActivity'
- Error connecting to Google Play Games
- Android Studio - Illegal character 8204 error
- Android Studio unable to run the project
- How do I know what is available in minSdkVersion in Android Studio?
- Android Studio update (version 1.2.1.1) - Cannot resolve symbol 'TintCheckBox'
- How to accept cookies when using a webservice - Android?
- How can I always show Android Studios Preview?
- Android Studio cannot recognize "setAdapter()" method
- Error inflating class Android support design
Related Questions in ANDROID-INTENT
- Unable to receive extras in Android Intent
- Android - No view found for fragment
- I want to Show Simple Toast Message When User Click On Media Controller button Pause/Start/Stop in video View Using Media Controller
- Android Studio - Illegal character 8204 error
- invoking application activity from url in email
- How to send object using getserializable extra method
- Google Play services LocationSettingsAPI - LocationSettingsRequest Dialog not Showing
- How to getCropAndSetWallpaperIntent(Uri imageUri) to work?
- Android put and get parcelable array error
- Save image from Camera take picture intent to application private storage
- how to get the URL from mainActivity to the second activity using intents?
- how to launch an image in a activity by clicking a button in a diffrent activity in android studio
- Cannot start activity using explicit intent
- Getting a files extension from Filepicker-Intent
- About getSharedPreferences
Related Questions in INTENTFILTER
- Tell android to start my App when opening files with a specific extension
- Create shortcut for specific activity on home screen
- Intent Filter for app in share menu - only show if LOCAL files are shared
- When app receives NFC data it opens "New Tag collected"
- Android app crashing with permissions issues when binding to service
- How to receive file using NFC (Android Beam) in Android
- Reading/Handling NFC Tags without activity
- Can Activity Monitor monitor activities started from external applications?
- Android Intent and Intent filter
- Android Deeplink pathPrefix Attribute Is Being Ignored
- BroadcastReceiver doesn't receive Intents from outer links
- How to get app details from receiving intent?
- Android intent-filter - custom extension
- Clicking on a link should pop my application
- Getting callback from payment gateway in webview
Related Questions in ANDROID-IMPLICIT-INTENT
- Implementing a File Picker in Android and copying the selected file to another location
- Pick contact directly from contact picker intent
- Why does the Main activity has an intent filter?
- What does it mean when two or more activities, each having intent-filter with action=android.intent.action.ACTION_MAIN?
- Get installed application details programatically for opening a pdf
- how to trigger particular app in android by default
- send SMS Intent in Android
- implicit intent for camera capture in android
- How can I get a number placed in a text message on Android?
- How to Show App's Name in "Completing action using" menu?
- how to get multiple selected files path for my activity-android
- Android service not starting with a warninig
- How to show list of installed calendars in settings screen of android
- Android:app creation malfunction(Implicit Intent)
- Does sinch SDK use implicit intent in their service?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
https://developer.android.com/reference/android/content/Intent.html#ACTION_MAIN
Launcher sends implicit intent to it. This is how launcher knows which activity is to be opened on click.
If you send improper data it will not open your activity. For ex: If you try to start your main activity using implicit intent only in startActivity then it will not start because there is CATEGORY_DEFAULT associated with it. You need to add one more intent_filter to your activity to resolve the intents.