Class: Android::Manifest::Activity
- Defined in:
- lib/android/manifest.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Component
Instance Attribute Summary
Attributes inherited from Component
#elem, #icon_id, #intent_filters, #metas, #name, #type
Class Method Summary collapse
-
.valid?(elem) ⇒ Boolean
the element is valid Activity element or not.
Instance Method Summary collapse
-
#default_launcher_activity? ⇒ Boolean
Whether this instance is the default main launcher activity.
-
#launcher_activity? ⇒ Boolean
Whether this instance is the launcher activity.
Methods inherited from Component
Constructor Details
This class inherits a constructor from Android::Manifest::Component
Class Method Details
.valid?(elem) ⇒ Boolean
the element is valid Activity element or not
84 85 86 87 88 |
# File 'lib/android/manifest.rb', line 84 def self.valid?(elem) ['activity', 'activity-alias'].include?(elem.name.downcase) rescue false end |
Instance Method Details
#default_launcher_activity? ⇒ Boolean
Returns whether this instance is the default main launcher activity.
98 99 100 101 102 103 |
# File 'lib/android/manifest.rb', line 98 def default_launcher_activity? intent_filters.any? do |intent_filter| intent_filter.exist?('android.intent.category.LAUNCHER') && intent_filter.exist?('android.intent.category.DEFAULT') end end |
#launcher_activity? ⇒ Boolean
Returns whether this instance is the launcher activity.
91 92 93 94 95 |
# File 'lib/android/manifest.rb', line 91 def launcher_activity? intent_filters.any? do |intent_filter| intent_filter.exist?('android.intent.category.LAUNCHER') end end |