0

When looking at most sites (including SO), most of them use:

<activity android:name=".MainActivity" />

insted of

 <activity android:name=".Complaints"> </activity>
  • What are the main differences between the two, if any?
  • Are there valid reasons to use one instead of the other?
  • Are there valid reasons to use combine them? Does using come with compatibility issues, seeing it is not very widely used?
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Avinash
  • 361
  • 4
  • 16

2 Answers2

0

First type is short way, else no difference at all but you can this as of if you have additional tags inside activity you will be using second type as you mentioned else it's up to you in which you feel comfortable go for that

Abdul Waheed
  • 4,540
  • 6
  • 35
  • 58
0
  • What are the main differences between the two, if any?

    No there is no difference between both of them both are valid

1. The XML Schema of the AndroidManifest file allows empty-elements. An element with no content is said to be empty. The representation of an empty element is either a start-tag immediately followed by an end-tag

<activity android:name=".MainActivity" />

2. when you need to supports nested inner tags in your <activity> tag than you should use for example

<activity android:name=".Complaints"> 
        <intent-filter>

        </intent-filter>
   </activity>`
Goku
  • 9,102
  • 8
  • 50
  • 81